Language: C++

import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
public class Main {
	public static void main(String args[]) {
		Sc sc = new Sc(System.in);
		String st = sc.n();
		boolean n = false;
		boolean e = false;
		boolean s = false;
		boolean w = false;
		for(int i = 0; i<st.length(); i++) {
			if(st.charAt(i) == 'N') n = true;
			if(st.charAt(i) == 'W') w = true;
			if(st.charAt(i) == 'E') e = true;
			if(st.charAt(i) == 'S') s = true;
		}
		boolean ok = (s == n) && (w == e);
		if(ok) System.out.println("Yes");
		else System.out.println("No");
	}
}
class Sc {
    public Sc(InputStream i) {
        r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasM() {
        return peekToken() != null;
    }

    public int nI() {
        return Integer.parseInt(nextToken());
    }

    public double nD() { 
        return Double.parseDouble(nextToken());
    }

    public long nL() {
        return Long.parseLong(nextToken());
    }

    public String n() {
        return nextToken();
    }

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null) 
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.IOException;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.InputStream;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.io.PrintWriter;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.io.OutputStream;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: expected unqualified-id before 'public'
    8 | public class Main {
      | ^~~~~~
a.cc:28:11: error: expected ':' before 'Sc'
   28 |     public Sc(InputStream i) {
      |           ^~~
      |           :
a.cc:28:26: error: expected ')' before 'i'
   28 |     public Sc(InputStream i) {
      |              ~           ^~
      |                          )
a.cc:32:11: error: expected ':' before 'boolean'
   32 |     public boolean hasM() {
      |           ^~~~~~~~
      |           :
a.cc:32:12: error: 'boolean' does not name a type; did you mean 'bool'?
   32 |     public boolean hasM() {
      |            ^~~~~~~
      |            bool
a.cc:36:11: error: expected ':' before 'int'
   36 |     public int nI() {
      |           ^~~~
      |           :
a.cc:40:11: error: expected ':' before 'double'
   40 |     public double nD() {
      |           ^~~~~~~
      |           :
a.cc:44:11: error: expected ':' before 'long'
   44 |     public long nL() {
      |           ^~~~~
      |           :
a.cc:48:11: error: expected ':' before 'String'
   48 |     public String n() {
      |           ^~~~~~~
      |           :
a.cc:48:12: error: 'String' does not name a type
   48 |     public String n() {
      |            ^~~~~~
a.cc:52:12: error: expected ':' before 'BufferedReader'
   52 |     private BufferedReader r;
      |            ^~~~~~~~~~~~~~~
      |            :
a.cc:52:13: error: 'BufferedReader' does not name a type
   52 |     private BufferedReader r;
      |             ^~~~~~~~~~~~~~
a.cc:53:12: error: expected ':' before 'String'
   53 |     private String line;
      |            ^~~~~~~
      |            :
a.cc:53:13: error: 'String' does not name a type
   53 |     private String line;
      |             ^~~~~~
a.cc:54:12: error: expected ':' before 'StringTokenizer'
   54 |     private StringTokenizer st;
      |            ^~~~~~~~~~~~~~~~
      |            :
a.cc:54:13: error: 'StringTokenizer' does not name a type
   54 |     private StringTokenizer st;
      |             ^~~~~~~~~~~~~~~
a.cc:55:12: error: expected ':' before 'String'
   55 |     private String token;
      |            ^~~~~~~
      |            :
a.cc:55:13: error: 'String' does not name a type
   55 |     private String token;
      |             ^~~~~~
a.cc:57:12: error: expected ':' before 'String'
   57 |     private String peekToken() {
      |            ^~~~~~~
      |            :
a.cc:57:13: error: 'String' does not name a type
   57 |     private String peekToken() {
      |             ^~~~~~
a.cc:70:12: error: expected ':' before 'String'
   70 |     private String nextToken() {
      |            ^~~~~~~
      |            :
a.cc:70:13: error: 'String' does not name a type
   70 |     private String nextToken() {
      |             ^~~~~~
a.cc:75:2: error: expected ';' after class definition
   75 | }
      |  ^
      |  ;
a.cc: In member function 'int Sc::nI()':
a.cc:37:16: error: 'Integer' was not declared in this scope
   37 |         return Integer.parseInt(nextToken());
      |                ^~~~~~~
a.cc:37:33: error: 'nextToken' was not declared in this scope
   37 |         return Integer.parseInt(nextToken());
      |                                 ^~~~~~~~~
a.cc: In member function 'double Sc::nD()':
a.cc:41:16: error: 'Double' was not declared in this scope; did you mean 'double'?
   41 |         return Double.parseDouble(nextToken());
      |                ^~~~~~
      |                double
a.cc:41:35: error: 'nextToken' was not declared in this scope
   41 |         return Double.parseDouble(nextToken());
      |                                   ^~~~~~~~~
a.cc: In member function 'long int Sc::nL()':
a.cc:45:16: error: 'Long' was not declared in this scope; did you mean 'long'?
   45 |         return Long.parseLong(nextToken());
      |                ^~~~
      |                long
a.cc:45:31: error: 'nextToken' was not declared in this scope
   45 |         return Long.parseLong(nextToken());
      |                               ^~~~~~~~~