Program Zif_3_29_Z(input,output);
Var x1,y1,x2,y2:integer;
    otv:boolean;
BEgin
     read(x1,y1,x2,y2);
     otv:=(abs(x1-x2)=1) and (abs(y1-y2)=2)or(abs(x1-x2)=2) and (abs(y1-y2)=1);
     writeln(otv)
End.