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: # template begins
  #####################################
   
  # import libraries for input/ output handling
  # on generic level
  import atexit, io, sys, math, heapq, collections
  
  #input handling
  #input of single integer
  def get_int(): return int(sys.stdin.readline().strip())
  #input of multiple integers
  def get_ints(): return map(int, sys.stdin.readline().strip().split())
  #input of list
  def get_list(): return list(map(int, sys.stdin.readline().strip().split()))
  #input of string
  def get_string(): return sys.stdin.readline().strip()
  
  #output handling
  #writing int output
  def write_int(a): sys.stdout.write(str(a)+"\n")
  #writing String
  def write_str(a): sys.stdout.write(a+"\n")
  #writing Array
  def write_list(arr): sys.stdout.write(" ".join(map(str, arr)) + "\n")
  
  #general functions
  #swap
  def swap(arr, a, b):
      arr[a]^=arr[b]
      arr[b]^=arr[a]
      arr[a]^=arr[b]
  
  #NumberOfDigits
  def int_len(a): return math.floor(math.log(a,10))+1
  
  #Powerof2
  def isPowerOfTwo(x): return x and (not(x & (x-1)))
  
  #Sieve
  def Sieve(n):
      prime = [True for i in range(n+1)]
      p = 2
      while (p * p <= n):
          if (prime[p] == True):
              for i in range(p * p, n+1, p):
                  prime[i] = False
          p += 1
      res = []
      for i in range(2,len(prime)):
          if (prime[i]):
              res.append(i)
      return res
  
  #binarySearch
  def binarySearch (arr, l, r, x):
      if r >= l:
    
          mid = l + (r - l) // 2
          if arr[mid] == x:
              return mid
          elif arr[mid] > x:
              return binarySearch(arr, l, mid-1, x)
          else:
              return binarySearch(arr, mid + 1, r, x)
      else:
          return -1
  def search(arr,x): return binarySearch(arr,0,len(arr)-1,x)
  
  #Array to String
  def toString(A): return''.join(A)
  
  # String to array
  def toArray(str): return str.split()
  
  #ArraySum
  def arrSum(Arr):
      Sum =0
      for i in range (len(Arr)):
          Sum+=Arr[i]
      return Sum
  
  def computeXOR(n) :
   
      # Modulus operator are expensive
      # on most of the computers. n & 3
      # will be equivalent to n % 4.
   
      # if n is multiple of 4
      if n % 4 == 0 :
          return n
   
      # If n % 4 gives remainder 1
      if n % 4 == 1 :
          return 1
   
      # If n%4 gives remainder 2
      if n % 4 == 2 :
          return n + 1
   
      # If n%4 gives remainder 3
      return 0
   
  
  def find_gcd(x, y):
       
      while(y):
          x, y = y, x % y
       
      return x
           
      
  
  
  #####################################
  # template ends
  
  # Code begins
  #####################################
  
  
  
  def isSubSequence(string1, string2, m, n):
      # Base Cases
      if m == 0:
          return True
      if n == 0:
          return False
   
      # If last characters of two
      # strings are matching
      if string1[m-1] == string2[n-1]:
          return isSubSequence(string1, string2, m-1, n-1)
   
      # If last characters are not matching
      return isSubSequence(string1, string2, m, n-1)
       
  
  N = get_int()
  while N >0:
      Str = get_string()
      A= Str.count("N")
      B = Str.count("E")
      if A==1:
          print("NO")
      else:
          print("YES")
  
  
  
  
      N-=1
  
  
  #####################################
  # Code ends
  
  
  # Creating 2D array sol = [[0 for i in range(N)] for j in range(N)]