program kon(input,output);
var  a1,a2,b1,b2:integer;
     c:boolean;
begin
  write('vvedite nach. koordinaty: ');read(a1,b1);
  write('vvedite konec. koordinaty: ');read(a2,b2);
  c:=(a1=abs(a2-1))and(b1=abs(b2-2))or(a1=abs(a2-2))and(b1=abs(b2-1))
  or(a1=abs(a2-2))and(b1=abs(b2-2))or(a1=abs(a2-1))and(a2=abs(b2-1));
  writeln(c)
end.