Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. a, b = [int(i) for i in input().split()]
  2. e, f, h = 25, -1, False
  3. for i in range(int(input())):
  4. c, d = [int(j) for j in input().split()]
  5. if i == 0 and c > a:
  6. h = True
  7. break
  8. if c < e:
  9. e = c
  10. if d > f:
  11. f = d
  12. if h:
  13. print("NO")
  14. elif e <= a and f >= b:
  15. print("YES")
  16. else:
  17. print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement