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 = input()
if 'E' in s:
    if 'W' not in s:
        print('No')
        exit()
elif 'E' not in s:
    if 'W' in s:
        print('No')
        exit()
elif 'N' not in s:
    if 'S' in s:
        print('No')
        exit()
else:
    if 'S' not in s:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
s_set = set()
for s in S:
  s_set.add(s)
if len(s_set) == 4:
  print('Yes')
elif len(s_set) == 2 and ('W' in s_set and 'E' in s_set) or \
('S' in s_set and 'N' in s_set):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if ('N' in s and 'S' in s) or ('S' in s and 'W' in s):
    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
    else:
        x += 1
print('Yes' if x == y == 0 else 'No')

Submission status: Wrong Answer

Solution code:
S = input()

n = S.count('N')
s = S.count('S')
w = S.count('W')
e = S.count('E')
a = 0

if n > 0:
    a += 1
elif s > 0:
    a -= 1
elif w > 0:
    a += 2
elif e > 0:
    a -= 2

if a == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

n = S.count('N')
s = S.count('S')
w = S.count('W')
e = S.count('E')
d = 0
if n > 0:
  d += 1
if s > 0:
  d -= 1
if w > 0:
  d += 1
if e > 0:
  d -= 1
  
if d == 0:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

if S.count('N') > 0 or S.count('S') > 0:
  if S.count('N') > 0 and S.count('S') > 0:
    ans = 'Yes'
  else:
    ans = 'No'
if S.count('W') > 0 or S.count('E') > 0:
  if S.count('W') > 0 and S.count('E') > 0:
    ans = 'Yes'
  else:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
#方角が南北/東西でセットであればよさげ
    s = input().rstrip()
    s = set(s)
    all_direction={'N', 'E', 'S', 'W'}

    if s == "WE" or s == "EW":
        print("Yes")
    elif s == "NS" or s ==  "SN":
        print("Yes")       
    elif s == set(all_direction):
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
#方角が南北/東西でセットであればよさげ
    s = input().rstrip()
    s = set(s)
    all_direction=["W","E","N","S"]

    if s == "WE" or s == "EW":
        print("Yes")
    elif s == "NS" or s ==  "SN":
        print("Yes")       
    elif s == set(all_direction):
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
#方角が南北/東西でセットであればよさげ
    s = input()
    s = set(s)

    if s == "WE" or s == "EW":
        print("Yes")
    elif s == "NS" or s ==  "SN":
        print("Yes")       
    elif s == set(["W","E","N","S"]):
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
#方角が南北/東西でセットであればよさげ
    s = input()
    s = set(s)
    if s == "WE" or s == "EW":
        print("Yes")
    elif s == "NS" or s ==  "SN":
        print("Yes")       
    elif s == "WENS" or s == "ENSW" or s == "NSWE" or s == "SWEN":
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
# A
from collections import Counter
S = list(input())
count = Counter(S)
print("Yes") if count["N"] == count["S"] and count["E"] == count["W"] else print("No")

Submission status: Wrong Answer

Solution code:
S = input()
set_ = set()

for i in S:
    set_.add(i)

if len(set_) == 4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
if "N" in s:
    if "S" in s: ans += 1
else: ans += 1
if "W" in s:
    if "E" in s: ans += 1
else: ans += 1
print("Yes" if ans==2 else "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)) or
  (('N' in s) and ('S' in s) and ('W' in s) and ('E' in s))
):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from collections import Counter
s = str(input())
s = Counter(s).most_common()
if len(s)%2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
li = list(map(str, input()))
x=0
y=0

for i in range(len(li)):
  if li[i]=='N':
    x=x+1
  elif li[i]=='S':
    x=x-1
  elif li[i]=='E':
    y=y+1
  elif li[i]=='W':
    y=y-1

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

Submission status: Wrong Answer

Solution code:
N = input()
NS = set(N)
if len(N) or len(NS) == 1:
    print("No")
elif "N" not in N and "S" not in N or "W" not in N and "E" not in N :
    print("Yes")
elif "N" in N and "W" in N and "E" in N and "S" in N:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
if "N" in N and "W" in N and "E" in N and "S" in N:
    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:
s = list(set(list(input())))

if len(s)%2 == 0:
    if ("N" in s and"S" in s) or ("E" in s and "W" in s):
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()


def walk(s):
    ls = len(s)
    nc = 0
    sc = 0
    wc = 0
    ec = 0
    l=[]
    for i in range(ls):
        if s[i] == "W":
            wc += 1
            l.append(wc)
        elif s[i] == "E":
            ec += 1
            l.append(ec)
        elif s[i] == "N":
            nc += 1
            l.append(nc)
        else:
            sc += 1
            l.append(sc)
    if (wc>0 and ec==0) or (wc==0 and ec>0) or (nc==0 and sc>0) or (nc>0 and sc==0):
        print("NO")
        return
    
    else:
        print("YES")
        return


walk(s)

Submission status: Wrong Answer

Solution code:
from collections import Counter

s = input()

c = Counter(s)

if len(c) == 4:
    print("Yes")
elif len(c) % 2 == 1:
    print("No")
else:
    li = list(c.keys())
    if ("S" in li and "N" in li) or ("W" in li and "E" in li):
        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"]>0 and C["S"]>0:
    if (C["E"]>0 and C["W"]>0) or (C["E"]==0 and C["W"]==0):
        print("Yes")
    else:
        print("No")
elif C["N"]==0 and C["E"]==0:
    if (C["E"]>0 and C["W"]>0) or (C["E"]==0 and C["W"]==0):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

ans1 = True
ans2 = True

if "N" in s:
    ans1 = "S" in s
if "W" in s:
    ans2 = "E" in s

print("Yes" if ans1 & ans2 else "No")

Submission status: Wrong Answer

Solution code:
s = input()

ans1 = True
ans2 = True

if "N" in s:
    ans1 = "S" in s
if "W" in s:
    ans2 = "E" in s

print("Yes" if ans1 and ans2 else "No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
if abs(S.count('S')-S.count('N')) % 2 == 0 and abs(S.count('E')-S.count('W')) % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
if "N" in s:
    if "S" in s:
        pass
    else:
        print("No")
        exit()
if "E" in s:
    if "W" in s:
        pass
    else:
        print("No")
        exit()
if len(set(list(s)))==3 or len(set(list(s)))==1:
    print("No")
    exit()
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import collections
S=list(str(input()))
cc=collections.Counter(S)

if cc['S']*cc['N']==0 and cc['S']+cc['N']==0:
    print('No')
elif  cc['E']*cc['W']==0 and cc['E']+cc['W']==0:
        print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import collections
S=list(str(input()))
cc=collections.Counter(S)

if cc['S']*cc['N']==0:
    print('No')
elif  cc['E']*cc['W']==0:
        print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import collections
S=list(str(input()))
cc=collections.Counter(S)

if cc['S']==0 and cc['N']!=0:
    print('No')
elif cc['S']!=0 and cc['N']==0:
    print('No')
elif  cc['E']==0 and cc['W']!=0:
        print('No')
elif  cc['E']!=0 and cc['W']==0:
        print('No')
elif cc['S']%2 ==cc['N']%2 and cc['E']%2==cc['W']%2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
l = list(input())
n = l.count('N')
w = l.count('W')
s = l.count('S')
e = l.count('E')
if (n + s) % 2 == 0 and (w + e) % 2 == 0:
    if n == s or (n != 0 and s != 0):
        if w == e or (w != 0 and e != 0):
            print('Yes')
            exit(0)
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ans = True
if ('S' in S + 'N' in S)&1:
        ans = False
if ('W' in S + 'E' in S)&1:
        ans = False
if ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
ans = True
if 'S' in S:
    if not 'N' in S:
        ans = False
if 'W' in S:
    if not 'E' in S:
        ans = False
if ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

cnt = 0

if not ("N" in s and "S" in s):
    cnt += 1
if not ("E" in s and "W" in s):
    cnt += 1

print("Yes") if cnt != 2 else print("No")

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

cnt = 0

if not ("N" in s and "S" in s):
    cnt += 1
if not ("E" in s and "W" in s):
    cnt += 1

print("Yes") if cnt == 0 else print("No")

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

cnt = 0

if not ("N" in s and "S" in s):
    cnt += 1
if not ("E" in s and "W" in s):
    cnt += 1

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

if not ("N" in s and "S" in s):
    print("No")
    exit()
    if not ("E" in s and "W" in s):
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

if not ("N" in s and "S" in s):
    print("No")
    exit()

if not ("E" in s and "W" in s):
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

if not ("N" in s and "S" in s):
    print("No")

if not ("E" in s and "W" in s):
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
n = 0
w = 0
s = 0
e = 0
x = len(S)
for i in range(x):
    if S[i] == 'N':
        n += 1
    elif S[i] == 'W':
        w += 1
    elif S[i] == 'S':
        s += 1
    elif S[i] == 'E':
        e += 1

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

Submission status: Wrong Answer

Solution code:
S = input()
n = 0
w = 0
s = 0
e = 0
x = len(S)
for i in range(x):
    if S[i] == 'N':
        n += 1
    elif S[i] == 'W':
        w += 1
    elif S[i] == 'S':
        s += 1
    elif S[i] == 'E':
        e += 1

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

Submission status: Wrong Answer

Solution code:
S = input()
n = 0
w = 0
s = 0
e = 0
x = len(S)
for i in range(x):
    if S[i] == 'N':
        n += 1
    elif S[i] == 'W':
        w += 1
    elif S[i] == 'S':
        s += 1
    elif S[i] == 'E':
        e += 1

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

Submission status: Wrong Answer

Solution code:
S = list(input())

res = True

if "N" in S:
    if not "S" in S:
        res = False

if "W" in S:
    if not "E" in S:
        res = False

if res:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from collections import Counter
s = input()
C = Counter(s)
if len(C) % 2 != 0:
    print('No')
    exit()
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s=input()
ans=[0]*4
check='NWSE'
for i in range(len(s)):
  for j in range(len(check)):
    if s[i]==check[j]:
      ans[j]+=1
if (ans[0]%2+ans[2]%2)%2==0 and (ans[1]%2+ans[3]%2)%2==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

from collections import Counter
c = Counter(rs())
f = False
if c['N'] == 0 or c['S'] == 0:
    if c['N'] == 0 and c['S'] == 0:
        f = True
elif c['W'] == 0 or c['E'] == 0:
    if c['W'] == 0 and c['E'] == 0:
        f = True
else:
    f = True
print('Yes' if f else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
set_s = list(set(s))
ans = ''
if set_s.count('N') == set_s.count('S') == set_s.count('E') == set_s.count('W'):
    ans = 'YES'
elif len(set_s) == 2 and set_s.count('E') == set_s.count('W'):
    ans = 'YES'
elif len(set_s) == 2 and set_s.count('N') == set_s.count('S'):
    ans = 'YES'
else:
    ans = 'NO'
print(ans)

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()
set_s = set(s)
ans = ''
if s.count('N') == s.count('S') == s.count('E') == s.count('W'):
    ans = 'YES'
elif len(set_s) == 2 and s.count('E') == s.count('W'):
    ans = 'YES'
elif len(set_s) == 2 and s.count('N') == s.count('S'):
    ans = 'YES'
else:
    ans = 'NO'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
set_s = set(s)
ans = ''
if len(set_s) == 2:
    if 'S' in set_s and 'N' in set_s:
        ans = 'YES'
    elif 'E' in set_s and 'W' in set_s:
        ans = 'YES'
    else:
        ans = 'NO'
elif len(set_s) == 4:
    ans = 'YES'
else:
    ans = 'NO'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
we = [0,0]
ns = [0,0]

for i in range(len(s)):
    if s[i] == ('N'):
        ns[0] == 1
    elif s[i] == ('W'):
        we[0] == 1
    elif s[i] == ('S'):
        ns[1] == 1
    else:
        we[1] == 1

if sum(we) % 2 == 0 and sum(ns) % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

if 'N' in S:
  if not 'S' in S:
    print('No')
    exit()
if 'S' in S:
  if not 'N' in S:
    print('No')
    exit()
if 'E' in S:
  if not 'W' in S:
    print('No')
    exit()
if 'W' in S:
  if not 'E' in S:
    print('No')
    exit()
print('YES')

Submission status: Wrong Answer

Solution code:
s = input()
N = s.count("N")
W = s.count("W")
S = s.count("S")
E = s.count("E")
flag = 1
if N > 0 :
    if S == 0 :
        flag = 0
if W > 0 :
    if E == 0 :
        flag = 0

if flag == 0:
    print("No")
else :
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())
len_s = len(s)
N = 0
S = 0
W = 0
E = 0

for i in range(len_s):
    if s[i] == "N":
        N += 1
    elif s[i] == "S":
        S += 1
    elif s[i] == "W":
        W += 1
    elif s[i] == "E":
        E += 1

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

Submission status: Wrong Answer

Solution code:
S = input()

n = 0
e = 0
w = 0
s = 0

for v in S:
    if v == 'N': n+=1
    if v == 'E': e+=1
    if v == 'W': w+=1
    if v == 'S': s+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

a = 'N' in s
b = 'S' in s
c = 'E' in s
d = 'W' in s
ans = all([a == b, c == d])
print(ans)

Submission status: Wrong Answer

Solution code:
a = str(input())
n = 0
e = 0
s = 0
w = 0
for i in a:
    if i=="N":
        n+=1
    if i=="E":
        e+=1
    if i=="S":
        s+=1
    if i=="W":
        w+=1
if n==s and e==w:
    print("Yes")
elif n>s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = str(input())
n = 0
e = 0
s = 0
w = 0
for i in a:
    if i=="N":
        n+=1
    if i=="E":
        e+=1
    if i=="S":
        s+=1
    if i=="W":
        w+=1
if n==s and e==w:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

a = set(s)
if len(a)%2 == 0:
	print("Yes")
elif len(a)%2 != 0:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
lat = lon = 0

for i in range(len(S)):
  if S[i] == "N":
    lat += 1
  elif S[i] == "S":
    lat -= 1
  elif S[i] == "E":
    lon += 1
  elif S[i] == "W":
    lon -= 1

if lat == 0 and lon == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
i = input()

if "S" in i and "N" not in i:
    print("No")
elif "E" in i and "W" not in i: 
	print("No")
else:
  	print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = input()
s = i.count("S")
n = i.count("N")
e = i.count("E")
w = i.count("W")
print(s,n,e,w)

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
S=input()
a=set()
for s in S:
  a.add(s)
a=list(a)
if len(a)==4:
  print('Yes')
elif len(a)==2:
  if (a[0]=='N' or a[0]=='S') and (a[1]=='N' or a[1]=='S'):
    print('Yes')
  elif (a[0]=='E' or a[0]=='W') and (a[1]=='E' or a[1]=='W'):
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(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 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=list(input())
n=len(s)
b=0
if 1<=n<=1000:
    b+=1
else:
    exit()
    
flag=0
a=0
for j in s:
    if (j=="N") or (j=="S") or (j=="E") or (j=="W"):
        a+=1
    else:
        exit()
        
for i in s:
    if i == "N":
        flag+=1
    if i == "S":
        flag-=1
    if i == "E":
        flag+=1
    if i == "W":
        flag-=1

if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
flag=0
for i in s:
    if i == "N":
        flag+=1
    if i == "S":
        flag-=1
    if i == "E":
        flag+=1
    if i == "W":
        flag-=1
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
t=set()
ans='No'
for i in range(len(S)):
    t.add(S[i])
if len(t)==4:
    print('Yes')
    exit()
elif len(t)==3:
    print('No')
    exit()
elif len(t)==2:
    if 'N' and 'S' in t:
        print('Yes')
        exit()
    elif 'W' and 'E' in t:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def resolve():
    S = str(input())
    n = S.count('N')
    s = S.count('S')
    w = S.count('W')
    e = S.count('E')
    if n > 0 and s == 0:
        print('No')
        return
    if n == 0 and s > 0:
        print('No')
        return
    if w > 0 and e == 0:
        print('No')
        return
    if w == 0 and e > 0:
        print('No')
        return

    if n % 2 == s % 2 and w % 2 == e % 2:
        print('Yes')
    else:
        print('No')

    return

resolve()

Submission status: Wrong Answer

Solution code:
S = input()

if ((S.count("N")>0 and S.count("S")==0) or (S.count("S")>0 and S.count("N")==0)) and ((S.count("E")>0 and S.count("W")==0) or (S.count("W")>0 and S.count("E")==0)):
  print("NO")
else:
  print("YES")

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()
ryoko={'S':False,'N':False,'W':False,'E':False}
for c in s:
    ryoko[c]=True
if (ryoko['S'] and ryoko['N']) or (ryoko['W'] and ryoko['E']):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input();

s = set(s)
print("Yes" if s == "WE" or s == "NS" or s == "SENW" else "No")

Submission status: Wrong Answer

Solution code:
s = input();

t = "NWSE"

f = 0
for i in range(4) :
  f += (s.count(t[i]) >= 1)
print('Yes' if f >= 4 else 'No')

Submission status: Wrong Answer

Solution code:
import collections

s=input()
a=collections.Counter(s)
f=True

if a['N']>0:
	if a['S']>0:
		pass
	else:
		f=False
elif a['W']>0:
	if a['E']>0:
		pass
	else:
		f=False
if f:
	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:
t = input()
n = t.count('N')
s = t.count('S')
w = t.count('W')
e = t.count('E')

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

Submission status: Wrong Answer

Solution code:
s=input()
if str(s in "S")==str(s in "N") and str(s in "E")==str(s in "W"):
    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()
print("Yes" if S.count("N")==S.count("S") and S.count("W")==S.count("E") else "No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
S = list(input())

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

Submission status: Wrong Answer

Solution code:
S = str(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:
st = input()
if "N" in st:
    if ("S" in st) is False:
        print("No")
        exit()
if "W" in st:
    if ("E" in st) is False:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(set(input()))
l = [["N","S"], ["W","E"], ["N", "S", "W", "E"]]
if len(s) != 2 and len(s) != 4:
    print("No")
    exit()
for i in l:
    x = 0
    for j in s:
        if j in i:
            x += 1
    if x == len(s):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = list(set(input()))
l = [["N","S"], ["W","E"], ["N", "S", "W", "E"]]
for i in l:
    x = 0
    for j in s:
        if j in i:
            x += 1
    if x == len(s):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = list(set(input()))
l = [["N","S"], ["W","E"], ["N", "S", "W", "E"]]
dame = True
for i in l:
    for j in s:
        x = 0
        if j in i:
            x += 1
        else:
            pass
    if x == len(s):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

if ('N' in s and 'S' in s) or ('W' in s and 'E' in s):
    if ('N' in s and 'S' in s) or ('W' in s and 'E' in s):
        print('Yes')
        exit()

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):
    if ('N' in s and 'S' in s) or ('W' in s and 'E' in s):
        print('Yes')
        exit()

print('No')

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
judge = 0
if 'N' in s:
    judge += 2
if 'W' in s:
    judge += 1/1000
if 'S' in s:
    judge -= 2
if 'E' in s:
    judge -= 1/1000

print('Yes' if judge == 0 else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
judge = 0
if 'N' in s:
    judge += 1
if 'W' in s:
    judge += 1/1000
if 'S' in s:
    judge -= 1
if 'E' in s:
    judge -= 1/1000

print('Yes' if judge == 0 else 'No')

Submission status: Wrong Answer

Solution code:
S = input()
now = (0, 0)
d = {'S': (0, -1), 'E': (1, 0), 'N': (0, 1), 'W': (-1, 0)}
res = "No"
for i in range(len(S)):
    now = (now[0] + d[S[i]][0], now[1] + d[S[i]][1])
    if now == (0, 0):
        res = "Yes"
        break
print(res)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    S = input().rstrip('\n')
    if ('S' in S == 'N' in S) and ('E' in S == 'W' in S):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    S = input().rstrip('\n')
    if 'S' in S == 'N' in S and 'E' in S == 'W' in S:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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