Problem:


Score : 200 points

Problem Statement

Snuke lives on an infinite two-dimensional plane. He is going on an N-day trip.
At the beginning of Day 1, he is at home. His plan is described in a string S of length N.
On Day i(1 ≦ i ≦ N), he will travel a positive distance in the following direction:

North if the i-th letter of S is N

West if the i-th letter of S is W

South if the i-th letter of S is S

East if the i-th letter of S is E

He has not decided each day's travel distance. Determine whether it is possible to set each day's travel distance so that he will be back at home at the end of Day N.

Constraints

1 ≦ | S | ≦ 1000

S consists of the letters N, W, S, E.

Input

The input is given from Standard Input in the following format:

S

Output

Print Yes if it is possible to set each day's travel distance so that he will be back at home at the end of Day N. Otherwise, print No.

Sample Input 1

SENW

Sample Output 1

Yes

If Snuke travels a distance of 1 on each day, he will be back at home at the end of day 4.

Sample Input 2

NSNNSNSN

Sample Output 2

Yes

Sample Input 3

NNEW

Sample Output 3

No

Sample Input 4

W

Sample Output 4

No



Sample input:
SENW


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
S=list(set(input()))
if len(S)==4 or S==['N','S'] or S==['W','E']:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
print("Yes" if any([all(["N" in S, "S" in S]), all(["W" in S, "E" in S])]) else "No")

Submission status: Wrong Answer

Solution code:
S=input()
n,w,e,s='N' in S, 'W' in S, 'E' in S, 'S' in S
print('Yes' if (n==s and e==w) else 'No')

print(n)
print(w)
print(e)
print(s)

Submission status: Wrong Answer

Solution code:
s = input()
N = s.count('N')
S = s.count('S')
E = s.count('E')
W = s.count('W')
if ((N >= 1 and S == 0) or (N == 0 and S >= 1) or 
    (E >= 1 and W == 0) or (E == 0 and W >= 1)):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
N = s.count('N')
S = s.count('S')
E = s.count('E')
W = s.count('W')
if (N >= 1 and S >= 1):
  print('Yes')
elif (E >= 1 and W >= 1):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
N = s.count('N')
S = s.count('S')
E = s.count('E')
W = s.count('W')
if (N >= 1 and S >= 1) or (E >= 1 and W >= 1):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()

tmp = 'NEWS'
answer = 'Yes'

for i in tmp:
    if S.count(i) == 0:
        answer = 'No'
        break
        
print(answer)

Submission status: Wrong Answer

Solution code:
s = input()
count = {"N":0, "W":0, "S":0, "E":0}
for i in s:
    count[i] += 1

if count["N"] == count["S"] and count["W"] == count["E"]:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
kita = s.count("N")
mina = s.count("W")
nisi = s.count("S")
higa = s.count("E")

if kita + mina != 0 and kita*mina == 0:
    print("No")
    exit()
if nisi + higa != 0 and nisi*higa == 0:
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())
if "N" in s and "S" in s and "W" in s and "E" in s:
  print('Yes')
elif  "W" in s==False and "E" in s==False and "N" in s==True and "S" in s==True :
  print("Yes")
elif "E" in s and "W" in s and "N" in s==False and "S" in s==False:
  print("Yes")
  
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())
if "N" in s and "S" in s and "W" in s and "E" in s:
  print('Yes')
elif  "W" in s==False and "E" in s==False and "N" in s==True and "S" in s==True :
  print("Yes")
elif "E" in s and "W" in s and "N" in s==False and "S" in s==False:
  print("Yes")
  
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if "N" in s:
  if "S" not in s :
    print("No")
    exit()
if "E" in s:
  if "W" not in s:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if "N" in s:
  if "S" not in s :
    print("No")
    exit()
if "E" in s:
  if "W" not in s:
    print("no")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
A = set(list(input()))
if len(A) == 2 and "S" in A and "N" in A or "W" in A and "E" in A or len(A) == 4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A = set(list(input()))
if len(A) == 2 or len(A) == 4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import collections
S=str(input())

List=list(set(S))
List.sort()

flag=0
if len(List)%2==0:
    if len(List)//2==1:
        if List[0]=="E" and List[1]=="W":
            flag=1
        elif List[0]=="N" and List[1]=="S":
            flag=1
    elif len(List)//2==2:
            flga=1
            
print("Yes" if flag==1 else "No")

Submission status: Wrong Answer

Solution code:
# import collections
S = input()
# CS = collections.Counter(S)
# print(CS)
cn = S.count('N')
ce = S.count('E')
cs = S.count('S')
cw = S.count('W')
if cn > 0 and cs > 0 and ce < 0 and cw < 0:
    print('Yes')
elif cn < 0 and cs < 0 and ce > 0 and cw > 0:
    print('Yes')
elif cn > 0 and cs > 0 and ce > 0 and cw > 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# import collections
S = input()
# CS = collections.Counter(S)
# print(CS)
cn = S.count('N')
ce = S.count('E')
cs = S.count('S')
cw = S.count('W')
if cn > 1 and cs > 1 and ce < 0 and cw < 0:
    print('Yes')
elif cn < 0 and cs < 0 and ce > 1 and cw > 1:
    print('Yes')
elif cn > 1 and cs > 1 and ce > 1 and cw > 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

if ('N' in S and 'S' in S) or ('W' in S and 'E' in S):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
import time
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    S = set(input())
    bl = False
    if S&{'E', 'W', 'N', 'S'}=={'E', 'W', 'N', 'S'}:
        bl = True
    if S-{'E', 'W'}=={}:
        bl=True
    if S-{'N', 'S'}=={}:
        bl = True
    print('Yes' if bl else 'No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S=set(list(input()))
n=0
s=0
e=0
w=0
if 'N' in S:
  n=1
if 'S' in S:
  s=1
if 'E' in S:
  e=1
if 'W' in S:
  w=1

if (n^s)&(e^w):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

S = input()
NSEW = [S.count("N"), S.count("S"), S.count("E"), S.count("W")]

if np.prod(NSEW) > 0:
    print("Yes")
elif NSEW[0] + NSEW[1] > 0:
    if NSEW[0] == 0 or NSEW[1] == 0:
        print("No")
        exit()
elif NSEW[2] + NSEW[3] > 0:
    if NSEW[2] == 0 or NSEW[3] == 0:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())

if len(set(s))%2==1:
    print('No')
if len(set(s))==4:
    print('Yes')
if len(set(s))==2:
    if list(set(s))==['N','S']:
        print('Yes')
    elif list(set(s))==['E','W']:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
# coding:utf-8

S = input()
n = S.count('N')
s = S.count('S')
e = S.count('E')
w = S.count('W')
print(n, s, e, w)

if (n == 0 and s != 0) or (n != 0 and s == 0):
    print('No')
elif (e == 0 and w != 0) or (e != 0 and w == 0):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
# coding:utf-8

S = input()
n = S.count('N')
s = -(S.count('S'))
e = S.count('E')
w = -(S.count('W'))

if n + s + e + w == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

s = input()

if len(set(s))%2 == 1:
    print("No")
else: 
    print("Yes")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

s = input()

if len(set(s))%2 == 1:
    print("No")
    exit()
if s.count('N')%2==s.count('S')%2 or s.count('W')%2==s.count('E')%2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

s = input()
if s.count('N')%2==s.count('S')%2 and s.count('W')%2==s.count('E')%2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

s = input()
print(s.count('W')%2)
if s.count('N')%2==s.count('S')%2 and s.count('W')%2==s.count('E')%2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
if 'N' in S and 'W' in S and 'S' in S and 'E' in S:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
a = S.count('N')
b = S.count('S')
c = S.count('E') 
d = S.count('W')

if a*b == 0 or c*d == 0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
a = S.count('N')
b = S.count('S')
c = S.count('E') 
d = S.count('W')

if a*b == 0 and c*d == 0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
a = S.count('N')
b = S.count('S')
c = S.count('E') 
d = S.count('W')

if a*b > 0 and c==0 and d==0:
  print('Yes')
elif c*d >0 and a==0 and b==0:
  print('Yes')
elif a==0 and b==0 and c==0 and d==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
a = S.count('N') - S.count('S')
b = S.count('E') - S.count('W')

if a == 0 and b == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
a = S.count('N') + S.count('S')
b = S.count('E') + S.count('W')

if a%2 == 0 and b%2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
S = S()
condition1 = 'S' in S == 'N' in S
condition2 = 'E' in S == 'W' in S
print('Yes' if condition1 and condition2 else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
if 'N' in s and 'W' in s and 'S' in s and 'E' in s:
    print('Yes')
elif 'N' in s and 'W' in s and 'S' not in s and 'E' not in s:
    print('Yes')
elif 'N' not in s and 'W' not in s and 'S' in s and 'E' not in s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if 'N' in s and 'W' in s and 'S' in s and 'E' in s:
    print('Yes')
elif 'N' in s and 'W' in s and 'S' not in s and 'E' not in s:
    print('Yes')
elif 'N' not in s and 'W' not in s and 'S' in s and 'E' in s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if 'N' in s and 'W' in s and 'S' in s and 'E' in s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
d = {'S':0,'N':0,'E':0,'W':0}
for i in s:
    d[i] += 1
ns = d['S'] > 0 ^ d['N'] > 0
ew = d['E'] > 0 ^ d['W'] > 0
if ns and ew:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
d = {'S':0,'N':0,'E':0,'W':0}
for i in s:
    d[i] += 1
ns = d['S'] > 0 and d['N'] > 0
ew = d['E'] > 0 and d['W'] > 0
if ns and ew:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
x = 0
y = 0
for i in S:
    if i == 'N':
        y += 1
    elif i == 'W':
        x -= 1
    elif i == 'S':
        y -= 1
    elif i == 'E':
        x += 1
if x == 0 and y == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if s.count('N') >= 1 and s.count('S') >= 1:
  if s.count('W') >= 1 and s.count('E') >= 1:
    print('Yes')
  elif s.count('W') ==0 and s.count('E') == 0:
    print('Yes')
elif s.count('N') == 0 and s.count('S') == 0:
  if s.count('W') >= 1 and s.count('E') >= 1:
    print('Yes')
  elif s.count('W') ==0 and s.count('E') == 0:
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if s.count("N") == s.count("S") and s.count("W") == s.count("E"):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

s = input()
cnt = [False]*4
for i in range(len(s)):
    if s[i] == "N":
        cnt[0] = True
    elif s[i] == "W":
        cnt[1] = True
    elif s[i] == "E":
        cnt[2] =True
    else:
        cnt[3] = True
ans = 0
for i in range(len(cnt)):
    if cnt[i] == True:
        ans += 1
if ans%2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if s.count("N") == s.count("S") and s.count("E") == s.count("W"):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
if len(set(s))%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if 0 in [s.count("W"),s.count("E"),s.count("N"),s.count("S")]:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if 0 in [s.count("W"),s.count("E")] or 0 in [s.count("N"),s.count("S")]:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
print(set(s))
if 0 in [s.count("W"),s.count("E")] or 0 in [s.count("N"),s.count("S")]:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if 0 in [s.count("W"),s.count("E")] and 0 in [s.count("W"),s.count("E")]:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if len(set(s)) in [3,1]:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())
s_set = set(s)

s_unique = list(s_set)
s_unique.sort()

s_unique_len = len(s_unique)

if s_unique_len == 4:
  print('Yes')
elif s_unique_len == 2:
  if s_unique[0] == 'E' and s_unique[1] == 'W':
    print('Yes')
  elif s_unique[0] == 'N' and s_unique[1] == 'S':
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
d = {}
print(S)

for s in S:
  d[s] = True

if 'N' in d:
  if 'S' not in d:
    print("No")
    exit()
    
if "S" in d:
  if 'N' not in d:
    print("No")
    exit()

if "E" in d:
  if "W" not in d:
    print("No")
    exit()
    
if "W" in d:
  if "E" not in d:
    print("No")
    exit()  
    
print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
d = {}
print(S)

for s in S:
  d[s] = True
  
if "N" in d:
  if 'S' not in d:
    print("No")
    exit()
    
if 'S' in d:
  if 'N' not in d:
    print("No")
    exit()

if 'E' in d:
  if 'W' not in d:
    print("No")
    exit()
    
if 'W' in d:
  if 'E' not in d:
    print("No")
    exit()  
    
print("No")

Submission status: Wrong Answer

Solution code:
s = input()
print("Yes" if len(set(s)) == 4 else "No")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

S = input()
C = collections.Counter(S)
if (C["N"] and not C["S"]) or ((not C["S"]) and C["N"]) or  (C["W"] and not C["E"]) or ((not C["E"]) and C["W"]):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
from collections import*
s=input()

c=Counter(s)

if (c["S"]==0 and c["N"]>0) or (c["S"]==0 and c["N"]>0) or (c["E"]==0 and c["W"]>0) or (c["W"]==0 and c["E"]>0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
from collections import*
s=input()

c=Counter(s)

if (c["S"]==0 and c["N"]>0) or (c["S"]==0 and c["N"]%2>0) or (c["E"]==0 and c["W"]>0) or (c["W"]==0 and c["E"]>0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
#template
S = list(input())
c = Counter(S)
news = ['N','E','W','S']
sa = set(S)
if sa == {'N','S'} or sa == {'E','W'}:
    print("YES")
    exit()
for i in range(4):
    if c[news[i]] == 0:
        print("NO")
        exit()
print("YES")

Submission status: Wrong Answer

Solution code:
a = input()
v = 0
h = 0
if a.count('W') >=1:
  if a.count('E') ==0:
    print('NO')
    exit()
if a.count('E') >=1:
  if a.count('W') ==0:
    print('NO')
    exit()
if a.count('N')>= 1:
  if a.count('S') ==0:
    print('NO')
    exit()
if a.count('S')>= 1:
  if a.count('N')==0:
    print('NO')
    exit()
print('YES')

Submission status: Wrong Answer

Solution code:
a = input()
v = 0
h = 0
if a.count('W') >=1:
  if a.count('E') ==0:
    print('NO')
    exit()
elif a.count('E') >=1:
  if a.count('W') ==0:
    print('NO')
    exit()
elif a.count('N')>= 1:
  if a.count('S') ==0:
    print('NO')
    exit()
elif a.count('S')>= 1:
  if a.count('N')==0:
    print('NO')
    exit()
print('YES')

Submission status: Wrong Answer

Solution code:
s = list(input())

s = set(s)

if len(s) % 2 == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()

cN, cS, cW, cE = 0, 0, 0, 0
for ch in S:
    if ch == 'E':
        cE += 1
    elif ch == 'W':
        cW += 1
    elif ch == 'S':
        cS += 1
    else:
        cN += 1

# もし左右，上下の回数が割り切れたらOK
# 仮定: cE > cW, cN > cS

if (cW == 0 and cE != 0) or (cW != 0 and cE == 0) or \
    (cS == 0 and cN != 0) or (cS != 0 and cN == 0):
    print("No")
elif cW == 0 and cW == 0:
    if cS != 0 and cN != 0:
        print("Yes")
    else:
        print("No")
else:
    if cS != 0 and cN != 0:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
S=input()

ans="NO"
n=0
w=0
e=0
s=0
tate=0
yoko=0

for str in S:
  if str=="N":
    n +=1
  elif str=="E":
    e +=1
  elif str=="S":
    s +=1
  else:
    w +=1

if (n>0 and s>0) or (n==0 and s==0):
  tate=True
if (e>0 and w>0) or (e==0 and w==0):
  yoko=True
  
if tate and yoko:
  ans="Yes"
  
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()

ans="NO"
tate=False
yoko=False

n=S.count("N")
w=S.count("W")
s=S.count("S")
e=S.count("E")

if (n>0 and s>0) or (n==0 and s==0):
  tate=True
if (e>0 and w>0) or (e==0 and w==0):
  yoko=True
  
if tate and yoko:
  ans="Yes"
  
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

S = Counter(list(input()))

if (S["N"] and S["S"]) or not(S["N"] or S["W"]) or (S["W"] and S["S"]) or not(S["W"] or S["S"]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
count = [0, 0, 0, 0]
for i in range(len(s)):
  if s[i] == "N":
    count[0] = 1
  if s[i] == "S":
    count[1] = 1
  if s[i] == "W":
    count[2] = 1
  if s[i] == "E":
    count[3] = 1
if (count[0] and count[1]):
  print("Yes")
elif  (count[2] and count[3]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
count = [0, 0, 0, 0]
for i in range(len(s)):
  if s[i] == "N":
    count[0] = 1
  if s[i] == "S":
    count[1] = 1
  if s[i] == "W":
    count[2] = 1
  if s[i] == "E":
    count[3] = 1
if (count[0] and count[1]) or (count[2] and count[3]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
count = [0, 0, 0, 1]
for i in range(len(s)):
  if s[i] == "N":
    count[0] = 1
  if s[i] == "S":
    count[1] = 1
  if s[i] == "W":
    count[2] = 1
  if s[i] == "E":
    count[3] = 1
if count[0] or count[1] or count[2] or count[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
count = [0, 0]
for i in range(len(s)):
  if s[i] == "N":
    count[0] += 1
  if s[i] == "S":
    count[0] -= 1
  if s[i] == "W":
    count[1] += 1
  if s[i] == "E":
    count[1] -= 1
if count[0] or count[1]:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
#A - Wanna go back home
S =input()
n = 0
w = 0
s = 0
e = 0
for i in range(len(S)):
    if S[i] == "N":
        n += 1
    elif S[i] == "W":
        w += 1
    elif S[i] == "S":
        s += 1
    else:
        e += 1

#print(n,w,s,e)

if abs(n - s) == 0 and abs(w - e) == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
set_s = list(set(s))
s_n = len(set_s)
if s_n == 1 or s_n == 3:
  print("No") 
elif s_n==2:
  if "N" in set_s and "S" in set_s:
    print("Yes")
  elif "E" in set_s and "W" in set_s:
    print("YES")
  else:
    print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if s.count('N') == s.count('S'):
    if s.count('W') == s.count('E'):
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
set_s = set(s)
s_n = len(set_s)
if s_n == 1 or s_n == 3:
  print("No")
elif s_n==2:
  if "N" in set_s and "S" in set_s:
    print("Yes")
  elif "E" in set_s and "W" in set_s:
    print("YES")
  else:
    print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
set_s = set(s)
s_n = len(set_s)
if n >= len(set_s):
  if s_n == 1 or s_n == 3:
    print("No")
  elif s_n==2:
    if "N" in set_s and "S" in set_s:
      print("Yes")
    elif "E" in set_s and "W" in set_s:
      print("YES")
    else:
      print("No")
  else:
      print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if ('S' in s and 'N' in s) or ('S' not in s and 'N' not in s):
    print('Yes')
elif ('E' in s and 'W' in s) or ('E' not in s and 'W' not in s):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
sets = set()
for v in s:
    sets.add(v)
    
ans = "Yes"
if "N" in sets and "S" not in sets:
    ans = "Np"
if "S" in sets and "N" not in sets:
    ans = "Np" 
if "E" in sets and "W" not in sets:
    ans = "Np" 
if "W" in sets and "E" not in sets:
    ans = "Np"    
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

if (s.count('S') >= 2 or s.count('S') == 0) and (s.count('E') >= 2 or s.count('E') == 0) and (s.count('N') >= 2 or s.count('N') == 0) and (s.count('W') >= 2 or s.count('W') == 0):
    print('Yes')
elif s.count('S') == s.count('E') == s.count('N') == s.count('W'):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = list(str(input()))

if len(set(s)) == 1 or len(set(s)) == 3:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
u, l = 0, 0
for i in s:
  if i=="N":
    u +=1
  elif i=="S":
    u -= 1
  elif i=="E":
    l += 1
  elif i=="W":
    l -= 1
    
print("Yes" if u==l==0 else "No")

Submission status: Wrong Answer

Solution code:
s=str(input())
x=int(0)
y=int(0)
for i in range(len(s)):
    if s[i]=='N':
        y+=1
    elif s[i]=='W':
        x+=1
    elif s[i]=='E':
        x-=1
    else:
        y-=1

if x==0 and y==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
S = list(input())[: -1]
if S.count("N") == S.count("S") and (S.count("E") == S.count("W")): print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
S = input()
print("Yes" if S.count('N')==S.count('S') and S.count('E')==S.count('W') else "No")

Submission status: Wrong Answer

Solution code:
s = input()
n_count = s.count('N')
s_count = s.count('S')
w_count = s.count('W')
e_count = s.count('E')
if n_count==s_count and w_count==e_count:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s=input()
if "N" in s:
  if "S" not in s:
    print("No")
    exit()
if "S" in s:
  if "N" not in s:
    print("No")
    exit()
if "W" in s:
  if "E" not in s:
    print("No")
    exit()
if "E" in s:
  if "W" not in s:
    print("No")
    exit()

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
if "N" in s:
    ans += 1
if "S" in s:
    ans += 1
if "E" in s:
    ans += 1
if "W" in s:
    ans += 1

if ans % 2:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())	
a=0
b=0
if ("N" in s)&("S" in s):
  a=1
if ("W" in s)&("E" in s):
  b=1
if a&b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())	
a=0
b=0
if ("N" in s)&("S" in s):
  a=1
if ("N" in s)&("S" in s):
  b=1
if a&b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())	

if s.count("W")==s.count("E"):
    if s.count("S")==s.count("N"):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'Yes'
n = 0
w = 0
sow = 0
e = 0
#print(s)
for i in range(len(s)):
    if s[i] == 'N':
        n += 1
    elif s[i] == 'W':
        w += 1
    elif s[i] == 'S':
        sow += 1
    else:
        e += 1



if (n == 0 and w != 0) or (n != 0 and w == 0):
    ans = 'No'
if (sow == 0 and e != 0) or (sow != 0 and e == 0):
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'Yes'
n = 0
w = 0
sow = 0
e = 0
#print(s)
for i in range(len(s)):
    if s[i] == 'N':
        n += 1
    elif s[i] == 'W':
        w += 1
    elif s[i] == 'S':
        sow += 1
    else:
        e += 1



if (n == 0 and w != 0) or (n != 0 and w == 0):
    ans = 'No'
if (sow == 0 and e != 0) or (sow != 0 and e == 0):
    ans = 'NO'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'Yes'
n = 0
w = 0
sow = 0
e = 0
#print(s)
for i in range(len(s)):
    if s[i] == 'N':
        n += 1
    elif s[i] == 'W':
        w += 1
    elif s[i] == 'S':
        sow += 1
    else:
        e += 1



if (n == 0 and w != 0) or (n != 0 and w == 0):
    ans = 'No'
if (sow == 0 and e != 0) or (sow != 0 and e == 0):
    ans = 'NO'
print('ans')

Submission status: Wrong Answer

Solution code:
S = input()
print("Yes" if S.count("N")==S.count("S") and S.count("E")==S.count("W") else "No")

Submission status: Wrong Answer

Solution code:
s = input()
south = s.count('S')
north = s.count('N')
east = s.count('E')
west = s.count('W')
print("Yes" if south == north == east == west else "No")

Submission status: Wrong Answer

Solution code:
s = input()
s = set(s)

if len(s)%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

dir = [0 for i in range(4)]
for i in range(len(s)):
    if s[i] == "N":
        dir[0] += 1
    elif s[i] == "W":
        dir[1] += 1
    elif s[i] == "S":
        dir[2] += 1
    elif s[i] == "E":
        dir[3] += 1

if 0 not in dir:
    print("Yes")
elif dir.count(0) == 3:
    print("No")
elif dir[0] == 0 and dir[0] == 0 or dir[1] == 0 and dir[3] == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
if len(set(s)) == 4:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
if (("N" in s) and ("S" in s)) or (("E" in s) and ("W" in s)):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

N,W,S,E = s.count("N"),s.count("W"),s.count("S"),s.count("E")

if (N > 0 and S == 0) or (N == 0 and S > 0) or (S > 0 and W == 0) or (S == 0 and W > 0):
	print("No")
else:
	print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

N,W,S,E = s.count("N"),s.count("W"),s.count("S"),s.count("E")

if N==S and W==E:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
S = input().strip()
C = {"N":0,"S":0,"E":0,"W":0}
for i in range(len(S)):
    C[S[i]] += 1
if C["N"]==C["S"] and C["E"]==C["W"]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
sl = list(input())
move = len(set(sl))

print('Yes' if move == 4 else 'No')

Submission status: Wrong Answer

Solution code:
sl = list(input())

x, y = 0, 0

for s in sl:
    if s == 'N' or 'S':
        y += 1
    else:
        x += 1

if x%2 == 0 and y%2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
sl = list(input())

x, y = 0, 0

for s in sl:
    if s == 'N':
        y += 1
    elif s == 'S':
        y -= 1
    elif s == 'E':
        x += 1
    elif s == "W":
        x -= 1

if x == 0 and y == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    ans = [0, 0]
    for si in s:
        if si == "N":
            ans[0] = min(ans[0] + 1, 1)
        elif si == "W":
            ans[1] = min(ans[1] + 1, 1)
        elif si == "S":
            ans[0] = max(ans[0] - 1, -1)
        else:
            ans[1] = max(ans[1] - 1, -1)
    if ans == [0, 0]:
        print("Yes")
    else:
        print("No")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
N = input()
lis = list(set(N))
if "S" in lis or "N" in lis:
    if "N" not in lis or "S" not in lis:
        print("NO")
        quit()
if "E" in lis or "W" in lis:
    if "E" not in lis or "W" not in lis:
        print("NO")
        quit()
print("YES")

Submission status: Wrong Answer

Solution code:
S = input()
w = S.count('W')
s = S.count('S')
e = S.count('E')
n = S.count('N')
if w == e and s == n:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
D = {}
for i in range(len(S)):
  if S[i] not in D:
    D[S[i]] = 1
if ('S' in D and 'N' in D) or ('E' in D and 'W' in D):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

s = input()
ans = 0

ans = s.count("N") * s.count("W") * s.count("E") * s.count("S")
#print(ans)

print("Yes" if ans!=0 else "No")