ZYB's Prime

Accepts: 5
Submissions: 89
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 131072/131072 K (Java/Others)
Problem Description
After getting $600$ scores in $NOIP$,$ZYB(ZJ-267)$ creates a problem:you are given $N$ numbers,now you are asked to divide them into $K$ groupsŁ¨$K \geq 1$),the number of each group must be no less than $3$,and put all the numbers in a group into a ring,the sum of every two adjacent numbers must be a prime.$ZYB$ want to ask you whether the $N$ numbers can be divided or not?
Input
In the first line there is the testcase $T$. For each teatcase: In the first line there is one number $N$. In the next line there are N numbers $A_i$. $1 \leq T \leq 50$,$1 \leq N \leq 200$,$1 \leq A_i \leq 200$,for $60$% cases $N \leq 20$.
Output
For each testcase,print the $YES$ or $NO$.
Sample Input
2
7
3 4 8 9 1 1 1
3
1 2 3
Sample Output
YES
NO