Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. x=int(input())
  2. y=int(input())
  3. xx=int(input())
  4. yy=int(input())
  5. xsp=x+1
  6. xsm=x-1
  7. ysp=y+1
  8. ysm=y-1
  9.  
  10. if(xx>=1 and xx<=8 and yy>=1 and yy<=8):
  11. if(xsp==xx and ysp==yy) or (xsm==xx and ysp==yy) or (xsp==xx and ysm==yy) or (xsm==xx and ysm==yy):
  12. print("YES")
  13. elif(xsp==xx and yy==y) or (xsm==xx and yy==y) or (xsp==xx and yy==y) or (xsm==xx and yy==y):
  14. print("YES")
  15. elif(xx==x and ysp==yy) or (xx==x and ysm==yy) or (xx==x and ysp==yy) or (xx==x and ysm==yy):
  16. print("YES")
  17. else:
  18. print("NO")
  19. else:
  20. print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement