i1 = int(input('enter the starting number of string\n'))
j1 = int(input('enter the starting number of column\n'))
i2 = int(input('enter the ending number of string\n'))
j2 = int(input('enter the ending number of column\n'))
print(-1 <= i1 - i2 <= 1 and -1 <= j1 - j2 <= 1)