问题 G: Until the Blue Moon Rises

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:10 通过:8

题目描述


You are given an array A=(A1,A2,…,An)A = (A_1, A_2, \dots, A_n)A=(A1,A2,,An) of nnn positive integers.
You can do the following operation any number of times (possibly, zero) on AAA:
  • Choose two distinct indices i,ji, ji,j (1≤i,j≤n1 \leq i, j \leq n1i,jn), then let Ai=Ai+1,Aj=Aj−1A_i = A_i + 1, A_j = A_j - 1Ai=Ai+1,Aj=Aj1.
Determine whether you can make all the integers in the array AAA prime numbers by applying the operations.
Recall that a prime number is a positive integer greater than 111 that is not a product of two smaller positive integers.

输入格式


The first line contains an integer nnn (1≤n≤10001\leq n\leq 10001n1000) — the length of array AAA.
The second line contains nnn positive integers A1,A2,…,AnA_1, A_2, \dots, A_nA1,A2,,An (1≤Ai≤1091\leq A_i\leq 10^91Ai109) — the integers in AAA.

输出格式


If it is possible to make all the integers in the array AAA prime numbers, print ‘Yes’ in a single line (without quotes). Otherwise, print ‘No’ (without quotes).

输入样例 复制

5
10 8 2 3 5

输出样例 复制

Yes

数据范围与提示