Prime String
Submissions: 5288   Accuracy:

35.78%

  Difficulty: Basic   Marks: 1

Provided a String of length N, your task is to find out whether or not the given string is a prime string. A prime string is a string in which the sum of the ASCII value of all the characters is prime.

Input:
The first line of the input contains an integer T, denoting the number of test cases. Then T test case follows. The first line of each test case contains an integer N denoting the length of the string, next line contains the input string str of length N.

Output:
For each test case print "YES" if the string is prime string else print "NO", on a new line.


Constraints:
1<=T<=102
1<=N<=108

Example:
Input

3
13
geeksforgeeks
4
JiiT
5
India
Output
YES
NO
NO

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Harshit Sidhwa
Author: harshitsidhwa


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.