Please note the first data step as a way to provide existing data.
data have;
input year x y;
datalines;
2000 . 5
2001 2 .
2002 3 .
2003 4 .
;
data want;
set have;
retain ly;
if _n_ =1 then ly=y;
else ly= ly*x;
run;
I'm placing the value of result into a new variable LY so the value persist across data step iterations with the RETAIN statement. If you attempt to Retain a variable in the source data set it gets reset each time a new observation is read from the source.
If you are going to have groups of records that need to "reset" the Ly, such as when apply this algorithm to person, geography, time or similar values you need to include more details as likely BY group processing with the First and Last options will come into play.