description: You had n positive integers a_1, a_2, ..., a_n arranged in a circle. For each pair of neighboring numbers (a_1 and a_2, a_2 and a_3, ..., a_{n - 1} and a_n, and a_n and a_1), you wrote down: are the numbers in the pair equal or not.
  
  Unfortunately, you've lost a piece of paper with the array a. Moreover, you are afraid that even information about equality of neighboring elements may be inconsistent. So, you are wondering: is there any array a which is consistent with information you have about equality or non-equality of corresponding pairs?
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases. Next t cases follow.
  
  The first and only line of each test case contains a non-empty string s consisting of characters E and/or N. The length of s is equal to the size of array n and 2 ≤ n ≤ 50. For each i from 1 to n: 
  
    * if s_i = E then a_i is equal to a_{i + 1} (a_n = a_1 for i = n); 
    * if s_i = N then a_i is not equal to a_{i + 1} (a_n ≠ a_1 for i = n). 
  
  Output
  
  For each test case, print YES if it's possible to choose array a that are consistent with information from s you know. Otherwise, print NO.
  
  It can be proved, that if there exists some array a, then there exists an array a of positive integers with values less or equal to 10^9.
  
  Example
  
  Input
  
  
  4
  EEE
  EN
  ENNEENE
  NENN
  
  
  Output
  
  
  YES
  NO
  YES
  YES
  
  Note
  
  In the first test case, you can choose, for example, a_1 = a_2 = a_3 = 5.
  
  In the second test case, there is no array a, since, according to s_1, a_1 is equal to a_2, but, according to s_2, a_2 is not equal to a_1.
  
  In the third test case, you can, for example, choose array a = [20, 20, 4, 50, 50, 50, 20].
  
  In the fourth test case, you can, for example, choose a = [1, 3, 3, 7].
solution: import java.util.*;
  import java.io.*;
  import java.lang.*;
  public class codeforces {
     static int max=Integer.MAX_VALUE,min=Integer.MIN_VALUE;
      long maxl=Long.MAX_VALUE,minl=Long.MIN_VALUE;
      static PrintWriter pw = new PrintWriter(System.out);
      static StringBuilder sb=new StringBuilder();
      static int parent[] = new int[100001];
      static int mod = 1000000007;
      static boolean b1 = true;
  
      public static void main(String []args) {
          FastScanner sc = new FastScanner();
  
                int ttt = sc.nextInt();
  
                while (ttt-- > 0) {
                   String s = sc.next();
                   int count=0;
                   for(int i=0;i<s.length();i++)
                       if(s.charAt(i)=='N')
                           count++;
                   if(count==1)
                       pw.println("NO");
                   else
                       pw.println("YES");
                 pw.flush();
      }
  
  
      }
      public static Boolean[] primeNo() {
          Boolean[] is_prime = new Boolean[1000001];
          int max = 1000000;
          for (int i = 2; i <= max; i++)
              is_prime[i] = true;
          is_prime[0] = is_prime[1] = false;
          for (int i = 2; (long)i*i <= max; i++) {
              if (is_prime[i] == true) {
                  for (int j = (i*i); j <= max; j += i)
                      is_prime[j] = false;
              }
          }
          return is_prime;
      }
  
      public static void union(int a,int b){
          parent[a] += parent[b];
          parent[b] = a;
      }
      public static int find(int a){
          if(parent[a]<0)
              return a;
          return (parent[a] =find(parent[a]));
      }
  
      public static class Pair{
          public  int x;
          public  int y;
          public Pair(int x,int y){
              this.x=x;
              this.y=y;
          }
      }
      public static long gcd(long a,long b){
  
          if(a==0)
              return b;
          return gcd(b%a,a);
      }
      public static int binarySearch(int arr[],int x){
          int l=0,r=arr.length-1;
          int result1=-1;
          while(l<=r)
          {
              int mid = l+(r-l)/2;
              if(arr[mid]==x)
              {
                  return mid;
              }
              else if(arr[mid]>x) {
                  r = mid-1;
              }
              else {
                  l = mid + 1;
              }
          }
          return result1;
      }
      public static class FastScanner {
          BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
          StringTokenizer st=new StringTokenizer("");
          String next() {
              while (!st.hasMoreTokens())
                  try {
                      st=new StringTokenizer(br.readLine());
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
          int[] readArray(int n) {
              int[] a=new int[n];
              for (int i=0; i<n; i++) a[i]=nextInt();
              return a;
          }
          long nextLong() {
              return Long.parseLong(next());
          }
      }
  }