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.math.*;
  public class Main{
  	//見なくていいよ　ここから------------------------------------------
  	static class InputIterator{
  		ArrayList<String> inputLine = new ArrayList<>(buf);
  		int index = 0; int max; String read;
  		InputIterator(){
  			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  			try{
  				while((read = br.readLine()) != null){
  					inputLine.addAll(Arrays.asList(read.split(" ")));
  				}
  			}catch(IOException e){}
  			max = inputLine.size();
  		}
  		boolean hasNext(){return (index < max);}
  		String next(){
  			if(hasNext()){
  				return inputLine.get(index++);
  			}else{
  				throw new IndexOutOfBoundsException("There is no more input");
  			}
  		}
  	}
  	//入力バッファサイズのつもり。入力点数（スペース区切りでの要素数）が100万を超える場合はバッファサイズを100万にすること
  	static int buf = 1024 * 1024;
  	static HashMap<Integer, String> CONVSTR = new HashMap<>();
  	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
  	static PrintWriter out = new PrintWriter(System.out);
  	static void flush(){out.flush();}
  	static void myout(Object t){out.println(t);}
  	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
  	static String next(){return ii.next();}
  	static boolean hasNext(){return ii.hasNext();}
  	static int nextInt(){return Integer.parseInt(next());}
  	static long nextLong(){return Long.parseLong(next());}
  	static double nextDouble(){return Double.parseDouble(next());}
  	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
  	static ArrayList<String> nextStrArray(int size){
  		ArrayList<String> ret = new ArrayList<>(size);
  		for(int i = 0; i < size; i++){
  			ret.add(next());
  		}
  		return ret;
  	}
  	static ArrayList<Integer> nextIntArray(int size){
  		ArrayList<Integer> ret = new ArrayList<>(size);
  		for(int i = 0; i < size; i++){
  			ret.add(Integer.parseInt(next()));
  		}
  		return ret;
  	}
  	static ArrayList<Long> nextLongArray(int size){
  		ArrayList<Long> ret = new ArrayList<>(size);
  		for(int i = 0; i < size; i++){
  			ret.add(Long.parseLong(next()));
  		}
  		return ret;
  	}
  	@SuppressWarnings("unchecked")
  	static String myconv(Object list, int no){//only join
  		StringBuilder sb = new StringBuilder("");
  		String joinString = CONVSTR.get(no);
  		if(list instanceof String[]){
  			return String.join(joinString, (String[])list);
  		}else if(list instanceof long[]){
  			long[] tmp = (long[])list;
  			if(tmp.length == 0){
  				return "";
  			}
  			sb.append(String.valueOf(tmp[0]));
  			for(int i = 1; i < tmp.length; i++){
  				sb.append(joinString).append(String.valueOf(tmp[i]));
  			}
  			return sb.toString();
  		}else if(list instanceof int[]){
  			int[] tmp = (int[])list;
  			if(tmp.length == 0){
  				return "";
  			}
  			sb.append(String.valueOf(tmp[0]));
  			for(int i = 1; i < tmp.length; i++){
  				sb.append(joinString).append(String.valueOf(tmp[i]));
  			}
  			return sb.toString();
  		}else if(list instanceof ArrayList){
  			ArrayList tmp = (ArrayList)list;
  			if(tmp.size() == 0){
  				return "";
  			}
  			sb.append(tmp.get(0));
  			for(int i = 1; i < tmp.size(); i++){
  				sb.append(joinString).append(tmp.get(i));
  			}
  			return sb.toString();
  		}else{
  			throw new ClassCastException("Don't join");
  		}
  	}
  	static ArrayList<String> myconv(String str, int no){//only split
  		String splitString = CONVSTR.get(no);
  		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
  	}
  	static ArrayList<String> myconv(String str, String no){
  		return new ArrayList<String>(Arrays.asList(str.split(no)));
  	}
  	public static void main(String[] args){
  		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
  		solve();flush();
  	}
  	//見なくていいよ　ここまで------------------------------------------
  	//このコードをコンパイルするときは、「-encoding UTF-8」を指定すること
  	static void solve(){//ここがメイン関数
  		int t = nextInt();
  		while(hasNext()){
  			ArrayList<String> s = nextCharArray();
  			int N = 0;
  			for(String c : s){
  				if(c.equals("N")){
  					N++;
  				}
  			}
  			if(N == 1){
  				myout("NO");
  			}else{
  				myout("YES");
  			}
  		}
  	}
  	//メソッド追加エリア　ここから
  
  
  
  	//メソッド追加エリア　ここまで
  }
  