Language: C

#include <stdint.h>

bool desH(char c, char d){
	if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
	return false;
}
bool desV(char c, char d){
	if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
	return false;
}

int main(){
	int i;
	char ruta[2000];
	while(scanf("%s",ruta)!=EOF){
		char auxH='o',antH='o',auxV='o',antV='o';
		bool h=true,v=true;
		i=0;
		while(ruta[i]!='\0'){
			if( (ruta[i]=='N') || (ruta[i]=='S')){

				if(antH!=ruta[i]){

					h=h?false:true;
					auxH=antH;
					antH=ruta[i];
				}
			}
			if( (ruta[i]=='E') || (ruta[i]=='W')){
				if(antV!=ruta[i]){
					v=v?false:true;
					auxV=antV;
					antV=ruta[i];
				}
			}
			i++;
		}
/
		if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
		else printf("No\n");
	}
	return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'bool'
    3 | bool desH(char c, char d){
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdint.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'desH':
main.c:4:84: error: 'true' undeclared (first use in this function)
    4 |         if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
      |                                                                                    ^~~~
main.c:4:84: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:4:84: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:16: error: 'false' undeclared (first use in this function)
    5 |         return false;
      |                ^~~~~
main.c:5:16: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: At top level:
main.c:7:1: error: unknown type name 'bool'
    7 | bool desV(char c, char d){
      | ^~~~
main.c:7:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'desV':
main.c:8:85: error: 'true' undeclared (first use in this function)
    8 |         if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
      |                                                                                     ^~~~
main.c:8:85: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:9:16: error: 'false' undeclared (first use in this function)
    9 |         return false;
      |                ^~~~~
main.c:9:16: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:15:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   15 |         while(scanf("%s",ruta)!=EOF){
      |               ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <stdint.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:15:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   15 |         while(scanf("%s",ruta)!=EOF){
      |               ^~~~~
main.c:15:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:33: error: 'EOF' undeclared (first use in this function)
   15 |         while(scanf("%s",ruta)!=EOF){
      |                                 ^~~
main.c:15:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:17:17: error: unknown type name 'bool'
   17 |                 bool h=true,v=true;
      |                 ^~~~
main.c:17:17: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:17:24: error: 'true' undeclared (first use in this function)
   17 |                 bool h=true,v=true;
      |                        ^~~~
main.c:17:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:24:45: error: 'false' undeclared (first use in this function)
   24 |                                         h=h?false:true;
      |                                             ^~~~~
main.c:24:45: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:38:1: error: expected expression before '/' token
   38 | /
      | ^
main.c:40:17: error: 'else' without a previous 'if'
   40 |                 else printf("No\n");
      |                 ^~~~
main.c:40:22: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   40 |                 else printf("No\n");
      |                      ^~~~~~
main.c:40:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:40:22: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:40:22: note: include '<stdio.h>' or provide a declaration of 'printf'