Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=int(input())
- y=int(input())
- xx=int(input())
- yy=int(input())
- xsp=x+1
- xsm=x-1
- ysp=y+1
- ysm=y-1
- if(xx>=1 and xx<=8 and yy>=1 and yy<=8):
- if(xsp==xx and ysp==yy) or (xsm==xx and ysp==yy) or (xsp==xx and ysm==yy) or (xsm==xx and ysm==yy):
- print("YES")
- elif(xsp==xx and yy==y) or (xsm==xx and yy==y) or (xsp==xx and yy==y) or (xsm==xx and yy==y):
- print("YES")
- elif(xx==x and ysp==yy) or (xx==x and ysm==yy) or (xx==x and ysp==yy) or (xx==x and ysm==yy):
- print("YES")
- else:
- print("NO")
- else:
- print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement