Hilbert's Hotel

medium
<a href="https://codeforces.com/contest/1344/problem/A" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Hilbert's Hotel</i></a>

Input Format

check the link

Output Format

check the link

Constraints

check the link

Example

Input
6
1
14
2
1 -1
4
5 5 5 1
3
3 2 1
2
0 1
5
-239 -2 -100 -3 -11
Output
YES
YES
YES
NO
NO
YES
Previous
Celex Update
Next
Orac And Lcm

Related Questions