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.io.FileInputStream;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.InputMismatchException;
  
  public class Main {
  
      public static void main(String[] args) throws Exception {
          int tc = io.nextInt();
          for (int i = 0; i < tc; i++) {
              solve();
          }
          io.close();
      }
  
      private static void solve() throws Exception {
          String s = io.next();
          int n = 0;
          for (char c : s.toCharArray()) {
              if (c == 'N') {
                  n++;
              }
          }
          io.println(n == 1 ? "NO" : "YES");
      }
  
      static void sort(int[] a) {
          ArrayList<Integer> l = new ArrayList<>(a.length);
          for (int i : a) {
              l.add(i);
          }
          Collections.sort(l);
          for (int i = 0; i < a.length; i++) {
              a[i] = l.get(i);
          }
      }
  
      //-----------PrintWriter for faster output---------------------------------
      public static FastIO io = new FastIO();
  
      //-----------MyScanner class for faster input----------
      static class FastIO extends PrintWriter {
          private InputStream stream;
          private byte[] buf = new byte[1 << 16];
          private int curChar, numChars;
  
          // standard input
          public FastIO() {
              this(System.in, System.out);
          }
  
          public FastIO(InputStream i, OutputStream o) {
              super(o);
              stream = i;
          }
  
          // file input
          public FastIO(String i, String o) throws IOException {
              super(new FileWriter(o));
              stream = new FileInputStream(i);
          }
  
          // throws InputMismatchException() if previously detected end of file
          private int nextByte() {
              if (numChars == -1) {
                  throw new InputMismatchException();
              }
              if (curChar >= numChars) {
                  curChar = 0;
                  try {
                      numChars = stream.read(buf);
                  } catch (IOException e) {
                      throw new InputMismatchException();
                  }
                  if (numChars == -1) {
                      return -1; // end of file
                  }
              }
              return buf[curChar++];
          }
  
          // to read in entire lines, replace c <= ' '
          // with a function that checks whether c is a line break
          public String next() {
              int c;
              do {
                  c = nextByte();
              } while (c <= ' ');
              StringBuilder res = new StringBuilder();
              do {
                  res.appendCodePoint(c);
                  c = nextByte();
              } while (c > ' ');
              return res.toString();
          }
  
          public String nextLine() {
              int c;
              do {
                  c = nextByte();
              } while (c < '\n');
              StringBuilder res = new StringBuilder();
              do {
                  res.appendCodePoint(c);
                  c = nextByte();
              } while (c > '\n');
              return res.toString();
          }
  
          public int nextInt() {
              int c;
              do {
                  c = nextByte();
              } while (c <= ' ');
              int sgn = 1;
              if (c == '-') {
                  sgn = -1;
                  c = nextByte();
              }
              int res = 0;
              do {
                  if (c < '0' || c > '9') {
                      throw new InputMismatchException();
                  }
                  res = 10 * res + c - '0';
                  c = nextByte();
              } while (c > ' ');
              return res * sgn;
          }
  
          public long nextLong() {
              int c;
              do {
                  c = nextByte();
              } while (c <= ' ');
              int sgn = 1;
              if (c == '-') {
                  sgn = -1;
                  c = nextByte();
              }
              long res = 0;
              do {
                  if (c < '0' || c > '9') {
                      throw new InputMismatchException();
                  }
                  res = 10 * res + c - '0';
                  c = nextByte();
              } while (c > ' ');
              return res * sgn;
          }
  
  
          public double nextDouble() {
              return Double.parseDouble(next());
          }
      }
      //--------------------------------------------------------
  }