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.lang.reflect.Array;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.Deque;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.LinkedList;
  import java.util.PriorityQueue;
  import java.util.Scanner;
  import java.util.Set;
  
  import javax.print.DocFlavor.STRING;
  
  public class Simple{  
  
      public static Deque<Integer> possible(int a[],int n){
          boolean bool = true;
          Deque<Integer> deq = new LinkedList<>();
          int i=0;
          int j=n-1;
          int max = n;
          int min = 1;
          while(i<=j){
              
              
              if(a[i]== min){
                  deq.addFirst(a[i]);
                  i++;min++;
                  continue;
              }
              if(a[j]== min){
                  deq.addLast(a[j]);
                  j--;
                  min++;
                  continue;
              }
              if(a[i]==max){
                  deq.addFirst(a[i]);
                  i++;
                  max--;
                  continue;
              }
              if(a[j]==max){
                  deq.addLast(a[j]);
                  j--;
                  max--;
                  continue;
              }
              Deque<Integer> d = new LinkedList<>();
              d.add(-1);
              return d;
  
          }
  
          
          return deq;
  
      }
  
      public static class Pair implements Comparable<Pair>{
          int val;
          int freq = 0;
  
          public Pair(int val,int freq){
              this.val = val;
              this.freq= freq;
          }
  
          public int compareTo(Pair p){
              if(p.freq == this.freq)return 0;
              if(this.freq > p.freq)return -1;
              return 1;
          }
  
  
      }
      public static long factorial(long n)
      {
      
        // single line to find factorial
        return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
      
      }
  
  
      static long m  = 998244353;
   
  // Function to return the GCD of given numbers
   static long gcd(long a, long b)
  {
      if (a == 0)
          return b;
      return gcd(b % a, a);
  }
   
  // Recursive function to return (x ^ n) % m
  static long modexp(long x, long n)
  {
      if (n == 0) {
          return 1;
      }
      else if (n % 2 == 0) {
          return modexp((x * x) % m, n / 2);
      }
      else {
          return (x * modexp((x * x) % m, (n - 1) / 2) % m);
      }
  }
   
  // Function to return the fraction modulo mod
   static long getFractionModulo(long a, long b)
  {
      long c = gcd(a, b);
   
      a = a / c;
      b = b / c;
   
      // (b ^ m-2) % m
      long  d = modexp(b, m - 2);
   
      // Final answer
      long ans = ((a % m) * (d % m)) % m;
   
      return ans;
  }
      // public static long bs(long lo,long hi,long fact,long num){
      //     long help = num/fact;
      //     long ans = hi;
      //     while(lo<=hi){
      //         long mid = (lo+hi)/2;
  
      //         if(mid/)
      //     }
      // }
      public static boolean isPrime(int n)
      {
   
          // Check if number is less than
          // equal to 1
          if (n <= 1)
              return false;
   
          // Check if number is 2
          else if (n == 2)
              return true;
   
          // Check if n is a multiple of 2
          else if (n % 2 == 0)
              return false;
   
          // If not, then just check the odds
          for (int i = 3; i <= Math.sqrt(n); i += 2)
          {
              if (n % i == 0)
                  return false;
          }
          return true;
      }
      public static int countDigit(long n)
      {
          int count = 0;
          while (n != 0) {
              n = n / 10;
              ++count;
          }
          return count;
      }
      public static void main(String args[]){  
          //System.out.println("Hello Java");
          Scanner s = new Scanner(System.in);
          int t = s.nextInt();
          
          for(int t1 = 1;t1<=t;t1++){
              String str= s.next();
              boolean bool = true;
              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");
              }
             
              
              
          }
              
      }
      //5
      // 2 4 6 8 10  
      
  
      
  
      
      
  }  
  
  /*abstractSys
  
  1 3 5 7 9
  1 2 3 4 5
  5 6 7 8 9
  
  
  
  
   
  
  
  
  
  
  */