Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a, b = [int(i) for i in input().split()]
- e, f, h = 25, -1, False
- for i in range(int(input())):
- c, d = [int(j) for j in input().split()]
- if i == 0 and c > a:
- h = True
- break
- if c < e:
- e = c
- if d > f:
- f = d
- if h:
- print("NO")
- elif e <= a and f >= b:
- print("YES")
- else:
- print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement