A. Sending a Sequence Over the Network : O(N^2)
time limit per test
1 s.
memory limit per test
256 MB
input
standard input
output
standard output

Submit your $$$O(n^2)$$$ solution for CF1741E : Sending a Sequence Over the Network here.

The verdict should be Time limit exceeded on test 12

Examples
Input
7
9
1 1 2 3 1 3 2 2 3
5
12 1 2 7 5
6
5 7 8 9 10 3
4
4 8 6 2
2
3 1
10
4 6 2 1 9 4 9 3 4 2
1
1
Output
YES
YES
YES
NO
YES
YES
NO