Generally Yi is the target for Xj <= i.
If I follow your logic, then Y0 = target for Xj < 0, and you have one element in your target array that doesn’t correspond to any input.
Even for time series prediction, the convention is to set Yi = Xi-1.