Limak is a smart brown bear who loves chemistry, reactions and transforming elements.In Bearland (Limak's home) there are n elements, numbered 1 through n. There are also special machines, that can transform elements. Each machine is described by two integers ai, bi representing two elements, not necessarily distinct. One can use a machine either to transform an element ai to bi or to transform bi to ai. Machines in Bearland aren't very resistant and each of them can be used at most once. It is possible that ai = bi and that many machines have the same pair ai, bi.Radewoosh is Limak's biggest enemy and rival. He wants to test Limak in the chemistry. They will meet tomorrow and both of them will bring all their machines. Limak has m machines but he doesn't know much about his enemy. They agreed Radewoosh will choose two distinct elements, let's denote them as x and y. Limak will be allowed to use both his and Radewoosh's machines. He may use zero or more (maybe even all) machines to achieve the goal, each machine at most once. Limak will start from an element x and his task will be to first get an element y and then to again get an element x — then we say that he succeeds. After that Radewoosh would agree that Limak knows the chemistry (and Radewoosh would go away).Radewoosh likes some particular non-empty set of favorite elements and he will choose x, y from that set. Limak doesn't know exactly which elements are in the set and also he doesn't know what machines Radewoosh has. Limak has heard q gossips (queries) though and each of them consists of Radewoosh's machines and favorite elements. For each gossip Limak wonders if he would be able to succeed tomorrow for every pair x, y chosen from the set of favorite elements. If yes then print "YES" (without the quotes). But if there exists a pair (x, y) from the given set that Limak wouldn't be able to succeed then you should print "NO" (without the quotes).

You should print q lines. The i-th of them should contain "YES" (without quotes) if for the i-th gossip for each pair of elements x and y (in the set xi, 1, xi, 2, ..., xi, ni) Limak is able to succeed. Otherwise you should print "NO" (without quotes).

NoteLets look at first sample:In first gossip Radewoosh's favorite set is {4, 2} and he has no machines. Limak can tranform element 4 into 2 (so half of a task is complete) and then 2 into 3, and 3 into 4. Answer is "YES", so R is increased by 1.In second gossip set in the input is denoted by {6, 2} and machine by (3, 4), but R is equal to 1, so set is {1, 3} and machine is (4, 5). Answer is "NO", so R isn't changed.In third gossip set {6, 4, 3} and machines (2, 5) and (4, 6) are deciphered to be {1, 5, 4}, (3, 6) and (5, 1).Consider Radewoosh's choices:   If he chooses elements 1 and 5, then Limak is able to transform 1 into 5, then 6 into 3, 3 into 2 and 2 into 1. If he chooses elements 5 and 4, then Limak is able to transform 5 into 6, 6 into 3, 3 into 4 (half way already behind him), 4 into 2, 2 into 1, 1 into 5. If he chooses elements 1 and 4, then Limak is able to transform 1 into 2, 2 into 4, 4 into 3, 3 into 6, 6 into 5 and 5 into 1. So Limak is able to execute task. Answer is "YES" and R is increased by 3 (it's equal to 4 now).In last gossip {1, 2} and (1, 2) are deciphered to be {5, 6} and (5, 6). Now there are 2 machines (5, 6) so Limak is able to execute task again.

The first line contains three integers n, m and q (1 ≤ n, q ≤ 300 000, 0 ≤ m ≤ 300 000) — the number of elements, the number of Limak's machines and the number of gossips, respectively. Each of the next m lines contains two integers ai and bi (1 ≤ ai, bi ≤ n) describing one of Limak's machines. Then, the description of q gossips follows. The first line of the description of the i-th gossip contains two integers ni and mi (1 ≤ ni ≤ 300 000, 0 ≤ mi ≤ 300 000). The second line contains ni distinct integers xi, 1, xi, 2, ..., xi, ni (1 ≤ xi, j ≤ n) — Radewoosh's favorite elements in the i-th gossip. Note that ni = 1 is allowed, in this case there are no pairs of distinct elements, so Limak automatically wins (the answer is "YES"). Then mi lines follow, each containing two integers ai, j, bi, j (1 ≤ ai, j, bi, j) describing one of Radewoosh's machines in the i-th gossip. The sum of ni over all gossips won't exceed 300 000. Also, the sum of mi over all gossips won't exceed 300 000. Important: Because we want you to process the gossips online, in order to know the elements in Radewoosh's favorite set and elements that his machines can transform, for on each number that denotes them in the input you should use following function: int rotate(int element){   element=(element+R)%n;   if (element==0) {       element=n;   }   return element;} where R is initially equal to 0 and is increased by the number of the query any time the answer is "YES". Queries are numbered starting with 1 in the order they appear in the input.

Input:
6 5 4
1 2
2 3
3 4
2 4
5 6
2 0
4 2
2 1
6 2
3 4
3 2
6 3 4
2 5
4 6
2 1
1 2
1 2

Output:
YES
NO
YES
YES

Input:
7 6 2
1 2
1 3
2 4
2 5
3 6
3 7
7 2
1 2 3 4 5 6 7
4 5
6 7
7 2
1 2 3 4 5 6 7
4 6
5 7

Output:
NO
YES

Input:
7 6 6
1 2
1 3
2 4
2 5
3 6
3 7
2 1
2 3
5 6
3 1
1 4 7
1 6
5 2
5 1 2 6 7
5 6
1 2
2 2
4 3
2 3
4 6
1 0
2
2 3
1 5
5 6
7 1
3 4

Output:
YES
NO
YES
YES
YES
YES

Input:
8 5 5
1 2
4 5
3 2
1 3
7 6
1 2
4
4 6
5 7
2 3
4 6
3 4
6 5
3 5
2 5
4 6
3 4
6 5
3 5
1 3
8 5
8 5
5 6 7 8 1 2 3 4
7 4
6 8
4 1
2 5
2 7
7 5
5 6 7 8 1 2 4
7 4
6 8
4 1
2 5
2 7

Output:
YES
NO
YES
NO
YES

Input:
15 14 5
1 2
2 3
2 4
4 5
4 6
6 7
6 8
8 9
8 10
10 11
11 12
12 13
13 14
13 15
2 2
4 10
14 9
1 7
4 7
1 15 14 3
1 3
2 5
4 7
6 9
8 11
10 13
14 15
4 7
14 13 12 1
14 1
15 3
2 5
4 7
8 9
8 11
12 13
3 2
2 10 6
14 8
7 11
4 2
6 7 8 13
8 14
1 8

Output:
NO
YES
NO
YES
YES

Input:
20 31 30
6 19
18 15
4 4
11 8
7 5
11 4
12 18
6 20
11 15
18 11
16 9
7 5
5 11
4 10
5 13
1 6
7 20
4 10
3 8
4 11
2 17
12 17
14 5
3 8
12 2
7 13
12 2
5 14
1 19
13 20
6 1
4 1
6 10 1 13
18 2
4 3
12 8 17 19
6 17
2 3
17 16
5 1
10 20 4 12 5
8 6
7 2
20 1 5 17 4 10 15
3 17
10 14
4 2
12 8 11 18
16 11
3 4
4 0
15 20 13 19
2 3
12 19
14 15
19 5
12 10
2 8
8 5
12 18
5 3
8 14
18 9
3 2
14 2
9 2
2 2
1 4
11
11 4
18 17
19 20
4 10
1 2
10
9 8
10 11
3 4
4 9...

Output:
NO
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO

Input:
20 29 30
12 12
18 20
8 10
11 13
6 14
14 2
11 9
17 19
16 12
12 2
4 1
9 9
16 5
7 3
1 4
7 7
15 4
15 1
19 20
5 10
5 8
16 4
7 3
17 19
16 11
18 19
9 13
16 11
6 12
5 2
4 20 15 12 14
2 20
12 13
3 2
11 8 7
11 6
6 13
5 0
13 20 11 7 19
1 0
18
4 4
15 19 1 7
11 14
16 11
7 12
3 11
4 2
4 20 13 9
1 10
9 10
2 0
2 5
4 1
3 5 15 16
18 11
3 2
8 11 7
13 11
14 12
2 2
6 9
15 5
9 11
2 3
12 7
15 10
18 14
17 9
5 2
11 12 16 4 8
19 11
11 7
1 3
8
17 12
11 15
...

Output:
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO

Input:
200 298 300
156 38
120 178
105 85
126 144
120 26
86 74
17 71
101 195
181 102
87 158
27 45
3 3
5 128
19 198
71 194
109 19
108 123
93 148
79 32
186 19
122 25
60 10
148 175
65 53
96 191
4 81
38 48
122 35
127 150
177 36
92 52
46 144
185 163
111 106
110 86
164 122
104 86
177 182
17 193
112 5
73 44
60 160
66 31
131 29
118 147
155 27
132 133
102 42
97 146
94 77
200 180
132 174
195 114
60 60
167 83
19 198
24 193
61 40
87 7
114 21
142 145
187 172
139 17...

Output:
NO
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
...

Input:
200 500 300
18 187
153 163
190 24
20 31
29 120
10 176
21 188
199 110
63 158
5 118
76 123
157 95
195 42
121 95
39 1
181 99
169 24
5 46
12 137
56 25
166 150
74 198
74 184
8 186
10 30
55 189
127 160
74 19
114 67
178 175
46 58
110 74
126 1
195 112
4 110
66 193
6 151
97 152
28 19
120 59
164 115
71 77
1 94
120 6
95 106
111 188
83 7
109 174
111 11
37 191
83 118
33 31
127 152
88 195
24 139
162 126
119 127
70 183
16 76
60 134
140 144
86 162
68 45
156 1...

Output:
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
...

Input:
300000 300000 100000
160929 71432
96089 139293
54396 157734
232292 177163
191909 99696
221233 204104
18470 205696
123600 11091
102768 171932
151745 208228
287022 24895
174931 273618
201599 6017
271578 265785
40515 212579
259694 272256
241203 286913
199344 252003
259502 111764
151369 27671
183476 60086
190292 192144
293822 35140
230477 225568
279323 85867
99066 232813
164389 164054
27439 260299
48203 15844
73344 186160
53905 160519
159293 8501
11363 211962
42040 288513
110...

Output:
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
...

Input:
300000 300000 100000
82505 228842
216491 152702
238284 42989
297063 210425
52597 136489
6095 250591
29094 257128
159243 37849
237517 271235
160943 90450
2287 200514
106884 224797
209380 236951
20356 276205
246501 87647
286405 15677
152258 16787
66119 235896
130317 231184
282921 37766
76588 61821
223770 180474
68440 254361
56988 185652
92928 257808
188759 266652
289742 79677
216373 143987
272523 195992
168336 8367
80548 118672
160516 296364
218821 15811
149521 224906
11564...

Output:
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
N...

Input:
300000 300000 1000
37283 175148
77518 293765
212454 31000
239800 244607
136138 13197
294016 194425
255261 258869
172038 258762
88733 208816
184871 177713
197186 206631
31250 34916
70160 122728
239518 215084
131897 13870
172629 117804
60758 81687
145913 262274
60669 49620
111759 30727
180413 291064
238920 53479
195305 31121
160351 63600
191953 12199
124593 163360
243765 102390
9020 163445
272137 31089
12389 136267
51795 199380
173994 266037
209003 123184
257379 237299
2361...

Output:
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
YES
N...

Input:
30 0 5000
30 62
10 24 2 28 3 23 8 18 29 11 17 13 16 7 19 12 20 26 1 25 5 27 30 4 22 14 15 9 21 6
24 3
3 11
23 26
28 29
28 23
27 23
23 10
11 17
30 3
4 3
26 13
11 6
8 13
15 17
18 10
6 15
21 21
6 26
11 18
5 13
8 9
3 23
18 2
10 16
11 21
6 13
16 22
22 20
6 10
6 9
11 14
27 12
24 21
6 29
22 3
26 1
2 14
20 22
30 8
17 2
16 7
14 10
4 7
17 28
6 8
24 16
3 3
13 26
8 23
27 24
6 22
8 2
7 13
6 30
19 19
12 27
30 18
3 17
17 6
4 13
3 22
26 30
30 68
2 5 20 27 3...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 20000
12218 244804
256485 202511
31579 131525
230776 209623
267543 216233
270071 53617
74267 247063
220902 75665
140632 129838
58346 108256
254261 114226
13395 257440
157900 54559
294180 47472
231683 261360
75419 147604
12157 70035
22832 127720
179887 168629
200383 70722
281930 161136
6766 43025
215666 281422
178736 68679
64227 109823
172481 165471
48025 242032
167396 189247
112473 43336
212685 179374
205481 117687
257094 61746
115939 116765
9824 202691
1396...

Output:
YES
NO
YES
NO
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
...

Input:
300000 300000 100000
13139 19165
297193 210625
154268 114333
263815 111167
206121 223569
141974 95506
242941 235814
267636 190176
167934 124349
267408 7880
104929 107256
122083 21720
109977 145058
14879 268206
41011 202302
191633 34498
54328 3527
118590 148577
200061 269737
189763 273287
296829 87940
247715 151354
130401 10765
203438 32562
204346 211219
198000 256404
101207 288758
230552 97925
140388 280193
135083 97570
115861 40104
20283 118195
44275 237407
14577 246983
...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES...

Input:
300000 300000 100000
45929 73240
89134 57928
223413 233625
235547 223420
259504 193148
233730 22059
185881 219447
226530 246892
5230 207547
294226 218421
25097 260850
7114 230904
75908 200760
265986 101232
20433 114658
177714 131677
45749 1675
243486 281654
141651 259022
185236 216131
73180 162122
203733 133500
63914 219237
280974 172825
42636 167580
278120 262928
278076 39710
297134 47974
156933 277105
76098 77329
218934 178489
53171 264774
115426 98337
176489 45008
1736...

Output:
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO...

Input:
20 32 30
18 12
17 15
16 17
20 14
14 20
11 16
11 16
19 3
6 14
18 7
2 5
5 1
6 18
4 14
15 19
4 2
6 18
5 4
1 9
10 13
3 8
1 9
16 17
12 6
18 18
7 7
8 3
7 18
19 19
3 15
3 19
10 13
1 2
7
13 18
13 16
3 1
5 16 9
9 13
2 1
11 1
15 5
6 1
13 5 11 6 19 18
2 18
4 2
16 13 11 4
13 11
2 3
5 4
18 15 19 3 12
4 12
10 13
11 5
2 17
2 0
12 8
2 1
1 12
20 1
3 0
10 15 3
3 1
8 20 18
12 10
5 1
3 11 1 5 7
1 1
3 3
18 20 8
3 12
11 6
20 5
3 3
6 12 9
5 16
13 13
17...

Output:
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO

Input:
20 32 30
18 19
6 14
4 13
9 15
10 16
19 17
20 18
1 2
2 5
7 7
6 6
14 20
10 16
2 5
10 8
17 18
3 4
2 1
13 4
12 6
9 15
13 13
7 4
3 7
12 14
18 11
3 3
16 16
20 11
13 16
4 3
10 8
2 5
17 8
16 9
9 17
16 8
17 14
10 15
4 1
17 10 15 19
10 20
3 4
1 11 17
18 15
1 15
18 17
1 15
6 2
17 1 18 16 10 15
15 1
11 19
2 0
8 9
4 1
7 20 3 2
20 11
3 0
15 10 8
3 4
17 9 1
15 11
11 9
17 9
1 20
3 3
11 19 2
20 2
15 18
11 20
4 1
1 15 2 9
20 15
6 2
3 17 11 2 19 7
20...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO

Input:
20 33 30
7 4
5 1
6 20
8 16
6 15
17 20
12 3
12 3
2 2
9 17
5 10
16 3
1 5
8 16
16 19
7 4
12 12
4 14
4 14
2 8
1 10
16 16
9 6
4 13
14 15
6 1
20 9
18 12
4 13
12 11
2 8
18 11
15 14
3 0
20 6 7
6 4
14 4 12 15 1 18
13 7
15 3
4 19
12 19
2 3
4 19
4 17
14 6
19 14
2 3
4 17
6 16
4 9
20 20
3 4
9 11 8
7 8
8 19
11 11
10 11
2 0
20 9
4 5
9 14 19 4
10 4
19 14
6 17
4 6
9 4
4 1
16 14 4 1
4 1
3 2
20 7 5
12 9
7 3
7 5
8 1 7 16 18 4 14
17 15
2 7
10 16
8 7...

Output:
NO
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO

Input:
20 29 30
7 12
5 6
20 1
1 15
3 6
17 3
13 11
15 8
18 1
16 7
9 18
6 3
12 16
2 20
13 18
14 19
14 10
17 6
4 16
20 2
5 6
9 13
17 16
9 11
1 8
14 19
16 16
10 14
1 10
6 2
18 19 15 14 8 1
16 10
2 11
4 1
12 16 7 15
12 20
3 1
7 15 20
8 14
4 0
14 8 16 2
4 1
5 3 9 19
10 4
3 2
7 2 1
12 1
8 14
2 5
3 13
18 5
13 6
11 3
5 17
6 4
4 1
7 9 15 1
20 12
5 1
12 18 2 3 11
7 16
3 1
3 7 15
13 2
3 1
2 7 15
3 4
3 4
19 16 6
11 19
4 10
19 17
10 17
1 1
1
2 15
3 1
...

Output:
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
NO
NO
NO
NO
NO

Input:
20 31 30
5 6
1 14
10 5
3 16
2 5
18 15
7 15
17 9
14 1
12 18
13 8
5 2
4 15
13 16
1 19
19 11
8 2
2 10
6 20
20 6
16 12
3 8
17 14
16 16
12 13
3 16
15 7
14 9
16 13
19 17
18 4
5 1
3 14 1 2 7
9 6
2 4
11 14
6 1
11 6
16 16
9 11
7 2
14 15 5 9 13 6 10
19 12
15 14
1 2
18
13 15
12 20
2 2
12 18
17 18
10 14
3 1
20 1 8
9 8
6 2
8 2 20 3 16 9
9 2
12 13
3 0
11 18 14
5 2
16 8 9 15 13
6 14
2 14
4 1
11 3 9 18
15 7
3 2
20 7 6
1 3
9 9
2 0
15 17
4 2
8 6 7 1...

Output:
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES

Input:
20 29 30
15 3
4 17
18 9
5 13
16 5
3 11
1 20
14 13
11 8
10 17
1 12
17 10
16 16
14 14
4 17
5 2
14 5
7 19
15 11
7 6
18 19
8 11
15 1
12 20
4 19
9 6
2 16
20 12
13 2
3 4
14 5 13
19 15
13 13
2 5
16 15
3 3
15 13 12
17 8
1 17
1 18
3 0
13 12 2
2 1
12 10
11 8
3 2
3 6 2
16 4
16 3
2 2
16 4
2 3
18 2
1 1
15
2 19
3 2
8 15 12
12 12
7 7
4 5
14 15 1 12
8 12
14 19
1 17
15 1
1 1
7 1
4 2 8 14 20 10 9
2 11
1 1
9
20 14
1 2
8
1 19
19 12
3 1
6 20 15
14 ...

Output:
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES

Input:
20 28 30
6 6
19 11
13 1
15 15
5 15
6 8
20 18
15 12
6 6
14 3
16 11
20 10
9 7
4 7
6 11
17 11
15 1
15 5
13 12
14 4
7 7
19 6
17 19
3 4
2 18
14 7
20 2
6 6
5 1
12 11 13 1 17
15 14
4 2
5 15 13 9
20 12
1 19
4 3
6 19 12 5
13 19
5 6
19 10
9 2
8 2 16 14 9 6 12 11 10
17 13
3 5
4 0
18 2 13 8
5 4
17 18 9 6 16
19 18
18 13
9 8
13 14
3 1
18 12 9
6 13
3 0
19 5 3
4 4
7 15 1 16
2 1
6 7
1 4
7 14
2 2
2 16
3 9
15 16
4 3
13 1 17 12
15 16
12 6
19 14
1 2
2
1...

Output:
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO

Input:
20 50 30
11 12
6 9
1 10
1 9
20 15
14 12
14 1
2 5
12 4
3 14
9 18
2 19
5 7
19 18
16 6
17 14
11 11
9 20
11 10
3 6
5 7
10 15
2 3
13 10
10 18
16 11
2 8
4 11
5 16
18 15
3 14
2 7
6 6
15 7
1 3
19 1
13 8
1 2
1 1
1 17
16 10
11 14
13 18
5 11
20 2
9 4
1 5
15 3
1 17
16 2
2 5
5 16
12 11
6 16
2 5
8 12
7 7
2 5
18 1
3 3
11 19
20 19
11 20
9 7
2 2
4 16
8 9
3 19
5 3
13 5 10 9 14
8 11
17 15
15 12
3 1
20 17 11
13 16
5 1
7 12 11 8 14
10 3
4 6
2 5 17...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

Input:
20 50 30
5 14
10 4
11 4
4 1
6 3
6 1
19 12
17 20
15 18
7 14
1 8
12 5
20 14
15 9
11 7
12 11
5 5
1 2
13 6
19 18
4 11
14 8
5 11
17 4
10 20
7 8
20 19
9 18
20 11
7 11
9 13
4 1
1 3
18 16
3 12
5 1
6 12
2 16
11 4
16 15
12 16
11 18
4 10
14 20
12 5
12 15
7 13
16 10
19 15
3 6
4 4
5 1 18 15
7 2
5 18
7 5
6 18
3 1
1 12 6
17 1
4 3
10 1 7 6
5 16
20 6
20 6
4 4
1 7 13 17
7 4
4 3
13 4
3 4
1 1
18
18 18
4 1
12 10 7 8
10 8
3 3
1 19 17
20 11
17 17
19...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

Input:
20 50 30
3 10
16 11
12 16
9 17
5 1
10 3
10 2
14 19
4 15
10 15
20 18
18 11
15 13
16 6
10 19
12 15
10 8
1 19
14 3
14 16
9 4
8 15
18 10
17 8
11 1
3 1
13 5
3 12
7 10
4 16
9 14
1 1
1 15
9 16
19 1
10 11
17 6
13 17
3 2
16 14
5 19
13 18
3 15
13 16
20 3
17 14
9 17
18 9
18 13
16 9
2 1
19 11
13 14
5 1
10 14 18 11 12
2 13
4 0
7 14 17 6
5 2
16 6 15 8 12
13 3
8 11
4 2
13 4 16 8
17 1
8 14
2 3
14 16
17 6
11 9
6 15
3 1
20 13 10
11 3
3 2
13 18 1
3 ...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES

Input:
20 32 30
12 4
19 3
15 16
13 17
17 20
1 19
15 12
2 16
16 12
7 6
16 20
4 15
2 15
5 9
13 20
13 11
18 13
11 18
10 9
20 11
10 5
18 20
2 4
4 14
5 11
18 17
17 11
12 2
3 3
16 4
20 20
3 1
3 2
16 10 1
18 7
16 17
3 1
1 17 4
9 1
4 2
12 5 3 16
14 14
2 18
1 1
6
11 5
4 4
17 19 18 7
2 19
12 14
1 9
19 14
2 4
4 17
8 3
5 2
1 2
13 14
3 2
4 10 5
11 2
16 18
5 3
2 6 4 12 9
3 1
16 12
12 1
2 2
14 9
10 16
10 7
3 1
6 15 8
6 5
3 2
16 15 7
3 16
3 12
2 2
3 ...

Output:
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO

Input:
20 30 30
17 16
14 4
20 16
14 12
6 16
17 6
8 13
2 3
7 19
11 7
13 19
17 20
16 10
15 13
10 10
6 20
3 6
7 7
17 10
13 7
9 15
18 3
4 3
4 12
20 10
19 5
5 18
5 7
13 5
10 6
1 3
18
19 2
19 3
3 19
6 1
19 10 9 14 13 3
7 14
3 2
3 8 19
3 5
8 16
5 4
8 7 5 4 20
11 11
10 20
5 4
10 5
3 3
3 1 19
15 18
3 9
14 15
2 4
10 4
1 4
4 10
16 4
14 7
2 0
9 14
4 2
1 5 12 4
12 10
15 4
3 4
16 10 7
3 7
2 4
13 4
7 4
3 1
13 11 18
6 4
6 0
2 5 8 12 17 19
4 0
8 3 5 18
...

Output:
YES
NO
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO

Input:
20 34 30
14 16
6 10
20 16
19 6
12 7
3 16
2 3
4 15
14 20
12 13
17 9
19 4
16 1
13 7
5 2
1 20
6 5
18 1
15 19
9 7
6 6
1 14
20 3
9 12
3 14
12 17
10 2
9 13
2 6
19 11
7 17
5 10
17 13
3 1
6 2
14 11 5 10 16 1
6 14
20 18
2 3
15 4
9 4
15 6
19 5
2 1
8 2
17 8
2 2
6 20
1 6
17 16
2 3
2 16
17 1
13 11
1 12
4 4
15 13 4 17
18 10
20 16
15 2
13 5
2 3
18 2
13 18
2 17
12 14
6 4
12 8 18 4 20 19
2 8
3 18
8 12
18 14
3 1
6 8 20
12 8
2 5
13 16
14 16
13 20
...

Output:
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO

Input:
200 310 300
181 142
76 76
2 86
144 106
8 148
105 75
80 21
165 161
107 176
158 84
172 172
41 192
190 33
60 49
129 155
65 177
20 186
114 136
31 126
71 41
5 56
57 185
43 105
81 24
18 48
94 151
152 117
143 174
183 32
144 95
100 53
21 66
169 154
86 122
70 106
171 195
140 108
14 62
149 149
167 73
16 143
167 9
80 165
186 164
63 98
79 200
159 127
190 67
121 40
57 195
56 63
87 163
125 84
76 97
109 55
68 58
94 71
16 16
54 49
17 48
93 107
7 9
69 93
133 1...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
...

Input:
200 309 300
156 108
190 154
118 147
115 15
40 38
191 189
97 106
200 52
115 197
148 51
135 167
144 140
139 168
142 169
44 62
193 31
168 27
146 35
13 27
107 173
152 189
91 63
191 39
196 47
164 164
83 36
164 164
181 108
110 140
110 110
125 80
161 164
80 162
200 132
151 152
13 117
37 157
111 85
111 195
156 48
124 101
76 133
186 26
43 10
59 146
125 89
58 173
61 122
132 158
199 32
59 146
3 123
91 63
6 107
181 155
45 169
2 126
188 42
86 196
84 25
6 153
...

Output:
NO
YES
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
...

Input:
200 315 300
27 160
32 59
128 15
71 48
83 83
40 17
82 47
68 111
113 136
81 43
168 140
197 89
173 133
134 80
99 33
170 129
124 65
187 173
145 54
41 104
128 46
72 196
191 127
149 136
154 46
188 165
14 7
31 147
121 57
46 6
141 77
191 112
37 37
67 138
106 86
158 194
131 5
77 179
52 39
70 78
150 115
139 49
181 2
11 168
181 199
169 120
18 200
41 5
19 19
59 69
123 104
89 152
110 29
142 44
113 108
152 53
129 11
135 80
136 57
17 11
177 165
68 24
130 167
...

Output:
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
...

Input:
200 319 300
160 100
25 164
123 101
67 89
24 149
189 96
133 160
123 35
2 158
159 102
29 69
164 6
54 3
155 153
137 128
103 50
46 10
144 61
71 76
190 27
138 64
160 180
60 60
146 93
14 166
34 83
138 75
55 33
126 91
136 198
106 91
130 86
43 47
199 66
60 95
60 174
12 173
175 41
82 124
38 181
52 19
182 113
61 61
68 70
171 49
66 78
179 166
2 176
24 182
21 180
9 172
169 14
198 11
189 84
135 15
190 86
30 30
55 33
99 99
101 58
15 154
42 14
57 57
63 13
1...

Output:
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
NO
...

Input:
200 317 300
190 186
123 29
146 54
74 74
70 1
37 180
7 77
107 4
198 60
153 107
87 34
46 18
147 16
95 89
197 197
134 190
121 108
53 88
133 176
63 60
147 86
60 161
170 170
140 30
169 188
158 69
52 21
155 165
125 125
171 147
38 99
53 188
76 119
7 193
178 178
61 64
175 79
167 186
44 166
89 102
123 61
125 137
85 61
173 82
82 181
88 68
81 72
106 14
28 75
119 161
160 20
185 107
113 161
45 65
100 81
62 33
93 82
188 45
85 162
183 41
98 98
60 76
45 65
1 ...

Output:
NO
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
Y...

Input:
200 317 300
16 125
49 104
26 75
68 68
97 94
98 121
10 13
139 106
178 116
29 68
143 164
167 78
78 171
27 129
26 77
9 195
156 198
98 65
97 157
29 115
87 69
42 92
176 45
135 157
44 2
183 58
14 5
72 88
160 160
119 119
159 51
122 11
95 102
163 98
67 56
31 127
163 47
31 182
65 100
121 126
173 104
151 84
23 144
131 148
39 117
179 159
166 153
161 195
140 1
120 46
88 62
111 144
137 129
168 15
46 89
113 57
81 133
68 53
169 5
128 151
20 177
49 63
55 67
9...

Output:
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
Y...

Input:
200 323 300
117 183
32 44
66 31
82 170
84 35
162 187
196 196
162 162
43 163
34 69
197 53
131 75
191 191
150 181
197 73
56 59
120 71
109 49
83 30
78 173
150 39
42 90
105 140
25 181
63 17
25 160
84 200
54 150
196 27
145 29
45 121
193 111
57 172
185 51
15 26
190 91
179 179
166 76
194 45
115 127
48 48
83 83
110 138
81 57
14 180
93 179
178 90
22 85
74 101
57 151
139 31
199 33
139 159
112 175
40 88
58 65
36 104
28 28
145 10
129 190
11 132
53 126
32 1...

Output:
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO...

Input:
200 308 300
85 54
124 166
165 90
115 87
23 52
39 184
186 68
43 150
66 71
187 74
123 181
30 157
101 58
6 23
151 177
147 56
97 131
195 96
84 113
77 125
96 32
111 111
189 49
57 57
65 84
152 16
8 142
172 193
141 56
99 66
188 91
173 166
25 49
99 115
34 121
23 52
23 191
6 74
196 36
98 124
135 57
94 121
75 6
31 82
79 63
114 114
197 89
185 53
179 42
115 10
35 35
50 165
79 184
14 38
143 7
79 145
193 172
179 91
163 145
96 91
12 113
11 117
176 182
81 144...

Output:
YES
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
YES
YES
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
N...

Input:
200 500 300
41 110
129 48
107 76
155 8
200 193
176 153
80 183
116 157
146 143
7 169
163 154
36 104
45 3
25 182
101 96
172 83
117 19
55 144
140 47
92 109
107 185
64 140
66 155
195 22
114 179
194 95
139 93
83 60
73 77
81 107
32 130
76 190
42 76
68 160
174 152
81 19
200 45
194 104
13 140
169 142
49 119
26 187
16 26
167 54
106 25
144 94
124 97
128 43
3 85
12 67
168 82
118 5
92 117
3 185
144 193
84 184
19 183
111 62
127 47
176 145
184 42
55 185
114 ...

Output:
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
...

Input:
200 500 300
140 77
182 111
130 138
14 181
143 59
4 135
54 187
126 16
47 94
92 170
44 122
131 197
56 142
15 180
35 163
55 47
42 66
129 121
23 106
152 82
156 137
36 199
111 188
33 112
177 167
39 107
181 141
162 33
184 30
196 172
94 166
176 137
139 148
160 81
187 169
4 128
101 151
130 32
118 12
196 85
152 21
74 21
14 33
45 181
115 21
55 199
192 175
90 50
2 120
92 138
158 92
67 107
197 166
68 50
168 14
196 105
8 96
160 13
8 90
154 65
15 67
182 143
...

Output:
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES...

Input:
200 500 300
175 53
183 180
187 106
106 100
32 190
191 138
176 127
60 92
4 17
192 114
159 103
13 190
70 138
198 171
171 91
136 18
40 81
27 134
196 131
26 61
171 139
159 187
92 107
168 171
17 66
138 105
87 52
117 85
171 104
200 145
135 138
112 70
16 45
71 50
82 93
199 45
124 190
164 16
196 107
82 190
175 54
77 84
47 199
100 71
33 97
3 151
13 21
33 128
176 111
53 110
90 131
145 10
200 107
106 54
138 160
99 61
164 86
174 109
81 183
154 39
145 92
84 ...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
...

Input:
200 500 300
96 194
9 85
153 96
2 109
166 144
49 64
17 86
93 147
193 63
169 139
53 55
55 24
197 13
42 86
50 35
171 9
112 27
132 70
150 147
41 170
86 113
117 20
75 3
150 27
173 23
88 166
79 39
166 33
150 112
27 147
93 44
144 69
27 16
194 48
21 73
153 186
148 132
193 138
120 156
88 69
135 107
47 131
17 152
35 170
103 142
200 186
65 186
194 153
93 8
107 41
41 4
20 61
59 142
46 169
137 55
28 75
130 114
22 135
158 109
44 183
22 50
136 200
79 188
34 ...

Output:
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
...

Input:
200 500 300
146 121
96 66
94 150
174 192
160 107
122 106
45 191
66 93
101 151
146 28
53 127
8 65
142 187
141 15
27 170
66 129
118 101
27 166
175 108
136 130
58 199
19 72
22 109
37 178
77 159
45 180
13 187
108 41
148 71
178 93
198 157
197 189
65 200
99 117
118 174
44 71
50 101
113 40
53 45
78 84
70 170
58 60
50 16
195 60
39 63
186 91
126 94
114 134
196 84
64 20
117 144
89 77
185 46
70 166
96 178
185 27
126 78
77 44
147 10
118 151
92 2
153 88
87 ...

Output:
YES
YES
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
...

Input:
300000 300000 100000
1526 127593
213608 60013
92816 55793
242612 76029
261123 77786
140902 46700
290081 153132
27685 123242
94986 125398
76228 215902
52286 227890
99387 212107
125850 86472
177173 146341
160103 203054
189609 15422
52385 147132
60587 166229
235437 293799
242419 285537
266970 194601
26124 165092
19233 68145
138547 206712
179809 6090
108293 102979
14897 46283
211436 173981
26149 95175
279145 264634
102730 165515
62480 41354
276705 290897
1192 112048
264869 27...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO...

Input:
300000 300000 100000
134117 145175
122698 76459
108687 168959
298914 61571
261969 145318
143439 274465
6915 124052
92902 139653
87369 62356
231920 26988
206506 58166
133910 276457
95531 110605
87933 164142
267914 74681
181250 213257
129043 108977
287958 96252
175979 95465
156727 81592
139032 215740
46954 69959
160673 105321
182889 239009
16338 58416
192245 198968
255794 3012
7520 117272
25472 83276
6387 237244
152786 256588
54640 103830
3012 165520
12304 228810
195977 579...

Output:
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
N...

Input:
300000 300000 100000
88804 241631
160422 243420
64334 282287
243756 227209
62655 154912
249867 62836
95490 110525
271019 281875
81821 170368
105341 203556
58589 187416
115666 206257
297711 36229
257214 287734
89029 284752
239153 37702
66936 258086
280225 88923
206819 5534
288236 148163
80990 43213
240949 140054
294797 123710
102433 297386
208495 253582
182439 272792
153293 144704
96821 245768
121901 132625
92039 111284
58928 32663
140533 33369
4341 272544
91738 180580
144...

Output:
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 100000
237878 269679
150727 156246
136793 95450
280125 234463
29477 42872
249783 151002
297297 119855
75949 63989
105315 32573
154394 124725
178697 238965
7139 136005
29569 173626
239515 84674
187555 233815
174538 44586
204681 61610
217604 357
49148 108605
80386 138608
269133 249369
160784 190528
130637 200689
117376 83106
88443 88173
38757 78993
31686 217759
213844 286810
198082 5786
85773 24539
213994 256917
143828 83426
287139 184792
108964 128068
18817 2...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 100000
294312 159053
187446 134560
38941 215264
293471 59054
252912 87746
235694 70551
250390 7258
280517 2059
68365 131800
104460 292827
164914 284326
268651 32568
51575 112664
197735 98645
69815 173099
123716 299710
60269 151287
114372 93707
160340 76130
72090 242379
263405 54151
76507 151383
99073 81680
135433 98446
73279 135951
184096 148880
279179 39327
173557 15301
54392 45670
1193 43704
18602 162076
94887 208041
137937 269108
298345 93306
87591 41619
...

Output:
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
...

Input:
300000 300000 100000
237124 289605
282991 239513
280660 78130
64682 83294
54059 148395
140983 12971
98823 108100
95361 251778
62425 142278
257736 171256
194642 162934
50816 276714
95883 12420
38559 89718
97267 23176
110923 286315
155371 68545
119440 57550
11913 146021
115351 238655
6559 34866
97278 285012
173693 36108
283409 170521
59070 253237
91240 293003
26710 142791
31046 136097
148488 74959
211165 14457
280692 182836
156778 21813
12986 123219
226903 116739
61242 1742...

Output:
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO...

Input:
300000 300000 100000
199797 182613
98895 14339
162800 296465
50625 178661
269000 202664
46543 30864
54972 199357
69129 113669
193274 297906
24044 219754
3929 230181
280127 198085
38702 289021
135870 261473
296987 223118
296479 210566
38076 278873
226685 222194
269091 76944
284822 177146
245264 215320
217802 235236
288206 206632
138924 249827
27597 222086
135524 17197
258271 296938
192525 124300
197577 151915
260912 282555
229417 91386
167523 167807
256989 246087
77279 2057...

Output:
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
...

Input:
300000 300000 100000
137406 278492
167182 180698
25355 63382
207269 10227
106117 227828
95074 43169
126483 190366
208119 216579
110830 271105
147065 115185
129362 35525
143906 147129
109591 219671
228863 75926
3562 111736
151411 275445
242589 201852
290897 28293
144266 158800
15400 281989
185708 98582
55165 135465
85015 83525
31780 2868
185478 196496
109202 134113
268349 209238
99759 47673
137372 53005
182348 10684
162588 297593
109552 123879
213116 215462
156793 125339
2...

Output:
YES
NO
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
...

Input:
300000 300000 100000
147542 203081
78202 168663
33810 3603
81125 156057
226022 152804
3888 99331
30006 45851
119307 217768
237129 29470
48292 214856
52972 215649
45990 187992
80734 48998
41081 183294
152586 252190
192608 261277
49225 268295
217885 237529
234305 253904
239961 191115
2955 2943
274378 132872
115908 228946
81104 224146
180129 151896
179982 34384
96695 206780
124882 252734
276222 141937
282488 215455
289112 202114
168483 266579
153046 252941
275884 212704
2072...

Output:
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 100000
161614 278929
258763 75368
132722 172248
89442 83794
1252 10617
40891 58487
30599 18531
126133 117623
143164 36499
209534 294318
104970 32429
283751 255970
237667 212242
96772 54627
286700 85486
42885 194338
172802 200088
265219 55448
268229 156744
93599 24930
175925 110870
291824 101672
294300 136066
212348 21444
117555 214417
12036 238054
25097 183973
292385 227991
117806 118623
12034 116149
296180 271084
193454 8857
285991 156564
85074 166394
59584...

Output:
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO...

Input:
300000 300000 100000
160982 211405
75149 221227
54401 256174
116490 60158
205317 99260
268970 296942
87130 176632
291430 159944
259641 109440
136308 281834
148064 36138
285894 36453
259991 207863
191737 7271
24287 134187
225808 246101
24126 7466
100417 121442
2432 195882
247185 64598
266337 158261
27122 36388
15255 196866
112646 295632
163798 167391
70946 167505
16121 85441
128181 26984
229294 77602
230517 249107
109846 143285
16855 268911
194425 133725
197885 14760
29121...

Output:
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YE...

Input:
300000 0 50000
2 9
48822 10918
48822 10918
10918 10918
48822 10918
48822 10918
10918 10918
10918 10918
48822 10918
10918 48822
48822 48822
3 5
191189 4149 102587
191189 191189
102587 191189
4149 4149
4149 4149
191189 4149
5 8
293407 165964 175708 257110 242192
293407 293407
293407 242192
257110 293407
242192 165964
257110 175708
165964 242192
165964 242192
175708 257110
3 9
295835 254273 140578
140578 140578
295835 140578
140578 140578
295835 140578
254273 254273
295835 ...

Output:
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES...

Input:
300000 0 10000
16 40
198264 289921 33474 136098 278964 187213 30542 145975 134290 85399 59979 138611 242887 74327 238797 9362
30542 74327
59979 238797
30542 138611
136098 145975
242887 289921
278964 136098
74327 59979
145975 242887
145975 187213
85399 136098
145975 136098
59979 242887
198264 138611
198264 9362
138611 145975
278964 85399
289921 278964
136098 85399
136098 30542
238797 136098
136098 289921
59979 198264
134290 289921
289921 242887
238797 136098
198264 145975
278964...

Output:
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
YES
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
YES...

Input:
300000 0 20000
6 22
275273 245095 137035 16723 190029 245420
275273 16723
275273 245420
245420 137035
16723 16723
245420 245420
16723 245420
245095 190029
190029 190029
245420 275273
190029 190029
190029 245095
245420 245420
275273 245420
16723 190029
16723 137035
190029 245420
137035 245095
245420 275273
245095 275273
16723 245420
245420 137035
275273 275273
9 12
87671 23959 205391 67785 115750 188587 157627 38091 5610
38091 188587
67785 87671
5610 67785
87671 5610
115750 56...

Output:
YES
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
YES
NO
NO
...

Input:
300000 300000 50000
297923 100763
144973 159223
174381 12424
98169 189569
29968 6626
174142 176672
6180 185866
766 116421
275172 125165
248184 287715
235703 95471
114366 195284
151559 65297
78881 250837
66115 2250
174837 9401
12004 123625
197840 174070
239215 54
55994 19396
27733 267700
247251 187923
155251 40312
7108 146736
282245 135645
289069 42359
246028 73397
103614 141502
189224 292768
226655 62777
215546 241990
3455 80069
296790 286922
85552 280249
232444 160475
2...

Output:
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
YES
NO
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
Y...

Input:
300000 300000 10000
59108 276977
179099 45278
72634 61784
69034 249844
149446 213108
94888 261007
58998 182301
239118 204786
76897 118381
6121 86686
125097 53545
6046 266894
295471 128934
96418 249295
186927 56227
266127 66891
221104 55510
235410 203320
227959 88858
121552 60227
273739 173747
200151 155639
46315 30389
170051 172312
90642 106639
139945 20651
163936 293414
180581 240809
99055 198074
131902 6672
52103 235460
197318 72449
200979 91729
208228 149157
64366 8662...

Output:
YES
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
...

Input:
150000 236900 1000
88534 89051
143631 107173
47050 19227
131461 70116
103816 43498
140660 2575
138510 116356
119928 60948
117931 122027
118512 19373
90684 102527
78853 30640
39453 117840
34257 62879
90584 21707
37924 29404
15359 16179
117587 126000
68883 60427
67664 123499
73483 8705
57184 41970
134905 19273
90644 29814
33830 59311
16644 67689
137609 39167
121799 83404
28381 97095
111821 35038
98125 140310
78789 952
62260 62260
57262 138571
121431 110580
50267 49335
965...

Output:
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
N...

Input:
150000 236802 1000
55955 86665
42708 105247
103893 103893
107887 109712
33492 146935
147876 68452
55356 82033
138569 13431
147792 90891
111187 127602
67073 112392
18844 125630
11483 164
81888 14175
84721 142103
106082 36362
30895 141110
46824 144686
32603 29119
77721 65161
147389 126528
103578 103578
121191 141607
43163 69244
40444 106288
115616 88958
90973 23947
25670 147718
143428 15813
1100 59784
1251 138399
129172 105787
108946 140625
30829 911
9473 128076
108863 258...

Output:
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
YES
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
YES
...

Input:
150000 236800 1000
140085 144957
132196 54091
139078 139078
116892 124051
54495 11108
132691 51461
71044 83140
10483 33266
23301 29900
29562 90867
120992 54290
92084 68807
6039 63083
11180 93694
51981 130903
17874 3751
67659 59906
104356 110799
100190 149273
1807 148232
52050 81202
75155 75155
62792 62792
124961 114433
14091 14091
7163 92247
135328 139401
130511 87283
47231 48983
145255 74978
73752 117490
133571 132820
135281 63632
29250 28597
52214 111808
5779 147649
6...

Output:
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
...

Input:
300000 300000 300000
201248 166382
165248 261861
197836 127303
36804 93403
39251 127062
135912 183654
202066 148577
214116 54801
55748 200638
96760 66917
66032 161861
55250 201344
53022 274037
192766 219882
18117 90147
238545 117961
20931 62527
27250 139132
240862 114088
160513 156813
298785 275423
42757 190157
197049 80413
146063 101577
184859 197637
56635 58704
123268 43812
272913 34643
209137 54306
177809 131185
124087 116529
243632 207811
140195 266029
264517 11261
24...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
Y...

Input:
300000 300000 100000
18634 269481
121790 189883
201347 200034
221090 197100
201210 53719
228764 102561
297805 102922
223407 65918
102661 264637
24706 129374
12271 172444
104845 226268
14781 6103
140893 210306
80995 241215
81284 220793
237669 119634
89336 87871
209584 152443
65427 270435
46134 278485
115973 252824
295811 180448
212882 32557
144241 135165
95420 126294
231980 217469
229660 57847
142545 276921
51200 11962
249905 41344
129621 224085
105789 260963
255804 136621
...

Output:
NO
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
NO
YES
...

Input:
300000 300000 10000
6714 84913
107795 29554
9120 117326
3078 195323
47110 162032
117048 224177
19808 58872
24849 104095
198485 297115
207739 80519
264020 107782
235880 111521
78494 271825
13837 36985
636 185440
88330 246658
90786 146063
211128 123705
289349 226241
257271 111100
172326 8601
156185 219450
171315 60442
138993 170880
88968 857
186723 171783
23265 196180
153467 112122
39152 269183
191466 245743
295993 235837
55490 80022
250936 165418
46592 186712
1476 188313
...

Output:
YES
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES...

Input:
300000 300000 100
265766 140395
180058 225984
42878 124922
102142 265437
29811 77409
54597 51433
292444 153149
233775 1215
180993 168829
55376 188306
296091 126365
269713 167845
157339 92233
134147 241479
176028 108065
292670 276033
189289 194935
24119 122116
35285 33484
190349 4525
52847 133667
128185 167530
106588 282805
257181 168626
17732 295082
30066 65081
182743 206434
18122 106303
6502 155521
188695 211513
95210 189312
144185 264658
275454 247812
289304 112002
2677...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

Input:
300000 300000 10
237625 152426
168959 64900
273486 294966
273015 60103
184507 78887
164812 16812
245331 238759
46323 258476
258593 275425
134995 189513
20890 85253
127371 187617
95414 272262
236409 188179
281587 107979
91744 81426
5412 30951
62950 98830
265719 280050
62678 95120
299307 191767
211982 289552
206870 178882
162738 186087
3404 168580
223152 136717
15709 44769
115104 58798
46108 212375
131734 110929
278962 72874
269088 246092
103185 51491
47874 140157
107705 18...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

Input:
1 0 1
1 300000
1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1...

Output: YES

Input:
700 244721 10000
15 289
124 592
109 179
143 400
304 193
254 405
269 606
177 333
534 178
245 635
560 447
545 516
185 200
642 433
7 85
289 589
545 684
17 110
186 608
660 196
422 189
666 449
203 173
234 60
206 136
251 319
53 143
346 485
258 211
420 281
481 520
425 636
345 523
183 204
659 339
661 662
483 339
249 40
286 174
495 5
103 192
384 490
540 608
221 672
389 435
675 413
28 160
169 424
541 433
689 62
286 613
229 655
264 188
517 633
419 492
405 356
9...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
Y...

Input:
300 0 250
300 1180
28 163 82 240 264 258 118 117 1 119 293 277 135 84 141 110 226 160 69 221 199 269 166 108 246 262 177 21 96 179 130 259 80 151 139 47 169 61 132 94 194 158 180 89 228 273 281 25 257 17 26 65 198 267 62 5 112 167 255 261 140 53 44 76 156 244 285 131 270 4 134 31 20 197 201 79 174 274 218 260 63 193 187 253 282 171 173 157 59 206 237 299 144 113 150 120 188 126 66 211 186 287 146 138 125 219 9 182 13 2 18 109 234 52 143 294 81 292 95 72 225 251 77 124 99 209 10 243 137 196 215 217 7 101 ...

Output:
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO...

Input:
300000 299999 300000
104303 101130
292690 181955
68691 103843
59464 151303
112731 88811
281826 32815
179936 15996
38345 49960
291148 285653
219016 256330
12394 283205
3143 267741
230393 134123
29118 198404
26287 209697
174333 113218
144686 272073
233787 252249
69148 80251
217265 95619
121651 294285
201547 218286
119129 35066
161573 285939
44085 128667
219691 198582
161793 127414
135981 293453
115502 231115
12453 185091
258701 291612
33829 148079
264340 257250
52964 14132
...

Output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
Y...

Input:
300000 299999 150000
90123 14826
193799 267662
192138 242882
153987 277481
104070 57291
230236 144802
216129 188004
19367 81012
233957 9059
274967 53881
147998 211560
90482 7870
214284 287232
27791 240318
259455 26213
7858 41725
117326 166979
149114 117149
159608 99217
3646 176587
219733 139911
68493 60160
210213 250562
171638 284299
126437 141084
47002 223449
190474 206879
204342 271465
24365 57824
43478 154647
133865 2698
191736 222978
86271 242910
257330 50611
177728 1...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 100000
151922 173962
70787 127817
289559 21376
115668 279851
65838 63386
127267 169103
289016 26150
63550 89768
178819 49630
216546 297861
245548 15100
124042 256711
272145 36900
274675 80838
20097 92118
98961 9688
56529 202576
295970 20370
176234 21499
49253 92739
22103 122551
46111 5958
28779 241011
164268 39816
176401 123824
91185 118879
106462 20044
120274 110213
39906 113987
73389 199118
53270 188913
119349 2395
246255 162857
79231 142522
219719 82058
...

Output:
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
...

Input:
300000 300000 100000
87805 11999
238914 46252
51479 79930
176860 130546
156500 285269
279970 288802
56138 86025
176518 159177
229266 95209
81083 232678
86755 175551
69135 167188
148012 146240
113459 112356
246314 71813
153139 141654
287895 25822
263233 26577
201600 227339
98346 208664
244621 216714
166200 192602
101493 200416
220725 148039
292171 86756
50172 186117
266886 15001
46657 245914
199346 74326
168889 205036
10390 197720
137565 66745
73343 145923
143548 206331
10...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 100000
66449 5406
65108 34755
180545 230554
39152 98348
40032 157914
262148 165574
85649 81626
50385 252660
190372 222830
174431 247940
277953 113613
263965 21831
281174 112065
159068 115933
250901 257801
79273 230832
59650 291573
29800 218323
191757 6332
116280 110961
178117 242694
150419 196777
9223 211444
21248 248210
251776 260123
181348 162850
228998 283443
148710 270642
118418 209307
160539 85936
42806 149532
146504 173572
41425 279750
108348 49926
517...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO...

Input:
300000 300000 100000
57687 101838
60234 4591
187675 266050
115556 139072
184754 167562
209859 84698
289879 24808
257886 8875
139944 200286
263862 8067
105167 152869
291629 136858
8980 96955
113414 24029
134653 151834
258242 272321
269004 207415
165091 164377
145542 48636
50220 88116
19754 243432
21739 60609
17733 284260
53223 78103
223206 151455
100810 67080
299153 109716
10465 278765
109099 181849
267995 189050
256469 278363
12429 206739
180426 2782
16057 277279
103914 2...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

Input:
300000 300000 50000
217828 249783
1456 26562
30332 128400
243848 111332
176984 21778
144605 213900
210201 169852
229616 87934
145520 63055
175743 260096
126857 102767
297313 88765
26152 110359
151253 17921
186573 21246
27220 253579
117034 60726
37651 175384
275179 116617
259169 42943
267314 279020
124394 240625
68689 25128
231092 255931
3275 23499
201548 288863
113176 97586
88412 240437
73190 157629
155512 74978
144725 38475
9611 223137
222584 155065
97514 264934
18141 19...

Output:
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YE...

Input:
300000 300000 50000
235071 270758
173181 162493
243824 26947
199000 183207
55642 217726
154982 259347
111953 69905
160329 139995
78778 212587
253706 129572
155297 84613
38547 83168
276186 57094
162462 165071
19184 127984
212297 133360
181160 89552
88567 209037
73662 131394
151106 32320
213292 21451
89450 211264
176738 258699
215534 219795
297746 270619
245399 73162
111304 91628
11473 237231
230976 172365
160056 26978
30080 143900
24351 111199
83455 293000
64985 195581
122...

Output:
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...