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.*;
  
  public class test {
  
      static long mod = 1000000007;
      static long inf = Long.MAX_VALUE;
      static final int maxSizeSeive = 1000001;
      static Vector<Boolean>isprime = new Vector<>(maxSizeSeive);
      static Vector<Integer>prime = new Vector<>();
      static Vector<Integer>SPF = new Vector<>(maxSizeSeive);
  
      public static void solve() {
          int count  = 0;
              for(int i = 0;i<str.length();i++){
                  if(str.charAt(i) == 'N')
                      count++; 
              }
              if(count == 1)
                  System.out.println("NO");
              else
                  System.out.println("YES");
      }
      
  /*
  input:
  
  
  output:
  
  
  */
      public static String str;
      public static void main(String[] args) {
          FastReader sc = new FastReader();
          int t = sc.nextInt();
          while(t-- > 0) {
              str = sc.next();
              solve();
          }
      }
  
      public static ArrayList<Integer> seivePrime(int n) {
          ArrayList<Integer> primes = new ArrayList<>();
          for (int i = 0; i < maxSizeSeive; i++){
              isprime.add(true);
              SPF.add(2);
          }
  
          manipulated_seive(n);
  
          for (int i=0; i<prime.size() && prime.get(i) <= n; i++) {
              primes.add(prime.get(i));
          }
          return primes;
      }
  
      public static void manipulated_seive(int N) {
          isprime.set(0, false);
          isprime.set(1, false);
           
          for (int i=2; i<N ; i++) {
              if (isprime.get(i)) {
                  prime.add(i);
                  SPF.set(i,i);
              }
  
              for (int j=0;j < prime.size() && i*prime.get(j) < N && prime.get(j) <= SPF.get(i);j++) {
                  isprime.set(i*prime.get(j),false);
                  SPF.set(i*prime.get(j),prime.get(j));
              }
          }
      }    
       
  	public static void sort(long[] a) {
  		ArrayList<Long> l=new ArrayList<>();
  		for (long i:a) l.add(i);
  		Collections.sort(l);
  		for (int i=0; i<a.length; i++) a[i]=l.get(i);
  	}
  
      public static int maxIndex(long[] arr) {
          long max = Long.MIN_VALUE;
          int index = 0;
          int n = arr.length;
          for(int i = 0; i < n; i++) {
              if(arr[i] > max) {
                  index = i;
                  max = arr[i];
              }
          }
          return index;
      }
  
      public static int minIndex(long[] arr) {
          long min = Long.MAX_VALUE;
          int index = 0;
          int n = arr.length;
          for(int i = 0; i < n; i++) {
              if(arr[i] < min) {
                  index = i;
                  min = arr[i];
              }
          }
          return index;
      }
  
      public static void debugArray(long[] arr) {
          for(int i = 0; i < arr.length; i++) {
              System.out.print(arr[i] + " ");
          }
          System.out.println();
      } 
  
      public static void debugArrayList(ArrayList<Long> arr) {
          for(Long i : arr) {
              System.out.print(i + " ");
          }
          System.out.println();
      }
  
      public static long gcd(long a, long b) {
          if(b == 0) {
              return a;
          }
          else {
              return gcd(b, a % b);
          }
      }
   
      public static long LCM(long a, long b) {
          return Math.abs(a*b) / gcd(a, b);
      }
  
      static class FastReader {
          BufferedReader br;
          StringTokenizer st;
      
          public FastReader() {
              br=new BufferedReader(new InputStreamReader(System.in));
          }
  
          String next() {
              while(st == null || !st.hasMoreElements()) {
                  try {
                      st=new StringTokenizer(br.readLine());
                  }
                  catch(IOException e) {
                      e.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          String nextLine() {
              String str="";
              try {
                  str=br.readLine();
              }
              catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          long[] readArray(int n) {
              long[] a = new long[n];
              for(int i = 0; i < n ; i++) {
                  a[i] = nextLong();
              }
              return a;
          }
      }
  }