Anthroov A.

Several powers of two are written in a row on the board in some order. For each pair of adjacent numbers, Petya wrote down in his notebook the power to which the left number must be raised to get the right number. The first number in the row on the board was 2, and the last number was 1024. Vasya claims that this is enough to find the product of all the numbers in the notebook. Is Vasya right?