| A2OJ Code Battle Final |
|---|
| Finished |
Today, Wet Shark was given a list of non-necessarily distinct prime integers, a1, a2, ...an.
Wet Shark defines k as the smallest integer such that for 1 ≤ i ≤ n, k mod ai = ai - 1.
Wet Shark also has an additional integer, o. Tell Wet Shark whether or not k is divisible by o.
The first line contains one integer, n 1 ≤ n ≤ 100000.
The second line consists of n space separated integers, the list of primes. Each prime ranges from 2 to 100000.
The third line consists of the additional integer, o, ranging from 1 to 100000.
If k is divisible by o, output "YES". Else, output "NO".
1
3
2
YES
2
3 3
4
NO
| Name |
|---|


