404652: GYM101604 D Wet Shark and Smallest Number

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Wet Shark and Smallest Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

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.

Output

If k is divisible by o, output "YES". Else, output "NO".

ExamplesInput
1
3
2
Output
YES
Input
2
3 3
4
Output
NO

加入题单

算法标签: