CPython lite logoProblemsContests

2106. Prime Number with Prime Frequency

You are given an array of n numbers, find any prime number that appears a prime number of times in the array.


Input

The first line contains an integer n(1n106).

The second line contains the numbers given separated by spaces, ai(1ai106).

Output

Output the solution on a single line. If there are multiple answers, output any of them. If there is no solution, output 1.


Sample input 1

4
1 2 2 3

Sample output 1

2

Sample input 2

5
1 2 2 2 2

Sample output 2

-1

Sample input 3

5
1 1 1 2 2

Sample output 3

2

Login to be able to submit.