SES algorithm, part one.

Ylist as y_1,y_2,...y_K. Xlist as x_1,x_2,...x_K