TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
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()

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()
print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
string = input()

c1 = True
c2 = True
c3 = True

if ("W" in string and not("E" in string) or "E" in string and not("W" in string): c1 = False
    
if ("N" in string and not("S" in string) or "S" in string and not("N" in string): c2 = False

if "N" in string and "S" in string and "E" in string and "W" in string:
    N = string.count("N")
    S = string.count("S")
    W = string.count("W")
    E = string.count("E")
    if not(N/S == W/E or N/S == E/W): c3 = False
    
if c1 and c2 and c3: print("Yes")
else: print("No")

string = input()

c1 = True
c2 = True
c3 = True

if ("W" in string and not("E" in string)) or "E" in string and not("W" in string): c1 = False
    
if ("N" in string and not("S" in string)) or "S" in string and not("N" in string): c2 = False

if "N" in string and "S" in string and "E" in string and "W" in string:
    N = string.count("N")
    S = string.count("S")
    W = string.count("W")
    E = string.count("E")
    if not(N/S == W/E or N/S == E/W): c3 = False
    
if c1 and c2 and c3: print("Yes")
else: print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
c = list(input())
print(['YES','NO'][('N' in c)^('S' in c)or('E' in c)^('W' in c)])

c = list(input())
print(['Yes','No'][('N' in c)^('S' in c)or('E' in c)^('W' in c)])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
if "N" in s:
  if "S" in s:
    continue
  else:
    print("No")
    exit()
if "E" in s:
  if "W" in s:
    continue
  else:
    print("no")
    exit()
print("Yes")

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()
if "S" in s:
  if "N" not in s :
    print("No")
    exit()
if "W" in s:
  if "E" not in s:
    print("No")
    exit()
print("Yes")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


str = input()
a = list(set(str))
if len(a)==4:
    print("YES")
elif len(a)%2==1:
    print("NO")
else:
    if ('N' in a and 'S' in a ) or ('W' in a and 'E' in a ):
        print("YES")
    else:
        print("NO")

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


str = input()
a = list(set(str))
if len(a)==4:
    print("Yes")
elif len(a)%2==1:
    print("No")
else:
    if ('N' in a and 'S' in a ) or ('W' in a and 'E' in a ):
        print("Yes")
    else:
        print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
a=[]
for i in range(n):
	x=int(input())
	a.append(x)
ans=0
for i in range(n-1):
	if a[i]>0:
		ans+=(a[i]//2)
		a[i]-=(a[i]//2)*2
	if a[i]>0:
		a[i+1]-=min(a[i],a[i+1])
		ans+=min(a[i],a[i+1])
if a[-1]>0:
	ans+=a[-1]//2
print(ans

n=int(input())
a=[]
for i in range(n):
	x=int(input())
	a.append(x)
ans=0
for i in range(n-1):
	if a[i]>0:
		ans+=(a[i]//2)
		a[i]-=(a[i]//2)*2
	if a[i]>0:
		a[i+1]-=min(a[i],a[i+1])
		ans+=min(a[i],a[i+1])
if a[-1]>0:
	ans+=a[-1]//2
print(ans)


=int(input())
a=[]
for i in range(n):
	x=int(input())
	a.append(x)
ans=0
for i in range(n-1):
	if a[i]>0:
		ans+=(a[i]//2)
		a[i]-=(a[i]//2)*2
	if a[i]>0:
		a[i+1]-=min(a[i],a[i+1])
		ans+=min(a[i],a[i+1])
if a[-1]>0:
	ans+=a[-1]//2
print(ans)


s=input()
S=s.count("S")
E=s.count("E")
N=s.count("N")
W=s.count("W")
a=0
b=0
if S>0 and N>0:
	a+=1
elif S==N==0:
	a+=1
if E>0 and W>0:
	b+=1
elif E==W==0:
	b+=1
if a==b==1:
	print("Yes")
else:
	print("No")



Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
dire = [0,0,0,0]
d = {c:i for i,c in numerate('WENS')}
for c in input():
	dire[d[c]] = 1
print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) else 'Yes')

dire = [0,0,0,0]
d = {c:i for i,c in enumerate('WENS')}
for c in input():
	dire[d[c]] = 1
print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) else 'Yes')

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# coding: utf-8

def main():
    S = input()
    dic = {'N':0, 'S':0, 'E':0, 'W':0}
    ans = 'No'

    for s in S:
        dic[s] += 1

    if (dic['N'] == 0 and dic['S'] == 0) or (dic['N'] > 0 and dic['S'] > 0):
        if (dic['E'] == 0 and dic['W'] == 0) or (dic['E'] > 0 and mp['W'] > 0):
            ans = 'Yes'

    print(ans)

if __name__ == "__main__":
    main()


# coding: utf-8

def main():
    S = input()
    dic = {'N':0, 'S':0, 'E':0, 'W':0}
    ans = 'No'

    for s in S:
        dic[s] += 1

    if (dic['N'] == 0 and dic['S'] == 0) or (dic['N'] > 0 and dic['S'] > 0):
        if (dic['E'] == 0 and dic['W'] == 0) or (dic['E'] > 0 and dic['W'] > 0):
            ans = 'Yes'

    print(ans)

if __name__ == "__main__":
    main()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
print("Yes" if ('N' in s) == ('S' in s) and ('W' in s) == ('E' in s) for s in [input()] else "No")


print("Yes" if 'N' in s and 'S' in s and 'W' in s and'E' in s for s in [input()] else "No")

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# 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')


# 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')
# print(cn, cs, cw, ce)
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')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = str(input())

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

S = str(input())

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#-*-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()

#-*-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()

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

def main():

    s = input().rstrip()
    s = set(s)
    WE={'W','E'}
    NS={'N','S'}
    all_direction={'N', 'E', 'S', 'W'}

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

if __name__=="__main__":
    main()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from collections import defaultdict as dd

s = input().strip()
coll = dd(int)

for el in s:
    coll[el] += 1


condition = (
    min(coll["N"], coll["S"]) == 0 and
    max(coll["N"], coll["S"]) != 0 or
    min(coll["E"], coll["W"]) == 0 and
    max(coll["E"], coll["W"]) != 0)

if condition:
    print("no")
else:
    print("yes")



from collections import defaultdict as dd

s = input().strip()
coll = dd(int)

for el in s:
    coll[el] += 1


condition = (
    min(coll["N"], coll["S"]) == 0 and
    max(coll["N"], coll["S"]) != 0 or
    min(coll["E"], coll["W"]) == 0 and
    max(coll["E"], coll["W"]) != 0)

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



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input();

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

s = input();

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
if ('N' in S) ^ ('S' in S) or ('W' in S) ^ ('E' in S):
  print('NO')
else:
  print('YES')


S = input()
if ('N' in S) ^ ('S' in S) or ('W' in S) ^ ('E' in S):
  print('No')
else:
  print('Yes')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def back_home():
    r=input()
    t=r.count('S') +1
    y=r.count('N') +1
    u=r.count('W') +1
    i=r.count('E')+1
    if (t>1 and y>1 and u==1 and i==1):
        print("YES")
    elif((t==1 and y==1 and u>1 and i>1):
       print("YES")
    elif ((t>1 and y>1 and u>1 and i>1):
        print("YES")
    else:
        print("NO")
        
back_home()

def backhome():
	s = input()
	if (('N' in s) and ('S' in s)) and not (('W' in s) or ('E' in s)):
		return "Yes"
	elif (('W' in s) and ('E' in s)) and not (('N' in s) or ('S' in s)):
		return "Yes"
	elif (('W' in s) and ('E' in s)) and (('N' in s) and ('S' in s)):
		return "Yes"
	else:
		return "No"

def back_home(r):
    l = dict()
    for i in r:
        if i in l:
            l[i]=int(l[i])+1
        else:
            l[i]=1
    if (len(l)==1):
        return('NO')
    elif(len(l)==2):
        if (len(l['S'])>0 and len(l['N']>0)):
            return ("yes")
        elif(len(l['E'])>0 and len(l['W']>0)):
            return("yes")
        else:
            return("NO")
    elif(len(l)==3):
        return("NO")
    else:
        return("YES")
        
back_home(S):

def back_home():
    S=input()
    if((('S'in S) and ('N' in S)) and not (('E' in S) or  ('W' in S))):
        print('Yes')
    elif(not (('S' in S) or ('N'  in S)) and (('E' in S) and ('W' in S))):
        print("Yes")
    elif((('S'in S) and ('N' in S)) and (('E' in S) and ('W' in S))):
        print("Yes")
    else:
        print("No")
          
back_home()

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s = list(input())
n = s.count('N')
w = s.count('W')
s = s.count('S')
e = s.count('E')
if (n + s) % 2 == 0 and (w + e) % 2 == 0:
    print('Yes')
else:
    print('No')

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')

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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')

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 sow != 0) or (n != 0 and sow == 0):
    ans = 'No'
if (w == 0 and e != 0) or (w != 0 and e == 0):
    ans = 'No'
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-


s = set(input())
if s in {{'N', 'S'}, {'W', 'E'}, {'N', 'W', 'S', 'N'}}:
    print('Yes')
else:
    print('No')

    

# -*- coding: utf-8 -*-


s = set(input())
if s in {{'N', 'S'}, {'W', 'E'}, {'N', 'W', 'S', 'N'}}:
    print('yes')
else:
    print('No')

    

# -*- coding: utf-8 -*-

s = set(input())
ans = 0
for i in s:
    if 'N' in i:
        ans += 1
    elif 'W' in i:
        ans += -2
    elif 'S' in i:
        ans += -1
    else:
        ans += 2
print('Yes' if ans == 0 else 'No')
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=set(input())
if len(s)%2==0:
  if s==set("SN") or s==set("WE"):
    print("Yes")
  else:
    print("No")
else:
  print("No")

s=set(input())
if len(s)%2==0:
  if s==set("SN") or s==set("WE") or s==set("WENW"):
    print("Yes")
  else:
    print("No")
else:
  print("No")

s=set(input())
if len(s)%2==0:
  if s==set("SN") or s==set("WE"):
    print("Yes")
else:
    print("No")
else:
  print("No")

from collections import*
s=input()

c=Counter(s)

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=list(input())
if l.count("N")==l.count("S") and l.count("E")==l.count("W"):
    print("Yes")
else:
    print("No")

s=list(input())
s_s=set(s)
l={"W","N","E","S"}
if s_s==l:
    print("Yes")
else: 
    print(("No")

s=input()
if ("S" in s)^("N" in s):
  print("No")
elif ("W" in s)^("E" in s):
  print("No")
else:
  print("Yes")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
linp = list(map(int, input().split()))

s = input()
ans = "Yes"
if "W" in s:
    if not "E" in s:
        ans = "No"
if "E" in s:
    if not "W" in s:
        ans = "No"

if "N" in s:
    if not "S" in s:
        ans = "No"
if "S" in s:
    if not "N" in s:
        ans = "No"

print(ans)


# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

s = input()
ans = "Yes"
if "W" in s:
    if not "E" in s:
        ans = "No"
if "E" in s:
    if not "W" in s:
        ans = "No"

if "N" in s:
    if not "S" in s:
        ans = "No"
if "S" in s:
    if not "N" in s:
        ans = "No"

print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = set(input())
flagNS = 'N' in S == 'S' in S
flagEW = 'S' in S == 'W' in S

print("Yes" if flagNS and flagEW else "No")

S = input()
flagNS = (('N' in S) == ('S' in S))
flagEW = (('E' in S) == ('W' in S))

print("Yes" if flagNS and flagEW else "No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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()

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()

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()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()

tmp = [0 for _ in range(4)]

res = 'Yes'
for i in range(len(S)):
    if S[i] == 'S':
        tmp[0] = 1
    elif S[i] == 'N':
        tmp[1] = 1
    elif S[i] == 'W':
        tmp[2] = 1
    else:
        tmp[2] = 1
        
if tmp[0] == 1 and tmp[1] == 0:
    res = 'No'
if tmp[1] == 1 and tmp[0] == 0:
    res = 'No'
if tmp[2] == 1 and tmp[3] == 0:
    res = 'No'
if tmp[3] == 1 and tmp[2] == 0:
    res = 'No'

print(res)



S = input()

tmp = [0 for _ in range(4)]

res = 'Yes'
for i in range(len(S)):
    if S[i] == 'S':
        tmp[0] = 1
    elif S[i] == 'N':
        tmp[1] = 1
    elif S[i] == 'W':
        tmp[2] = 1
    else:
        tmp[3] = 1
        
if tmp[0] == 1 and tmp[1] == 0:
    res = 'No'
if tmp[1] == 1 and tmp[0] == 0:
    res = 'No'
if tmp[2] == 1 and tmp[3] == 0:
    res = 'No'
if tmp[3] == 1 and tmp[2] == 0:
    res = 'No'

print(res)



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()

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

home = False
if n and s:
    if e and w:
        print("YES")
    elif not e and not w:
        print("YES")
    else:
        print("NO")

elif not n and not s:
    if e and w:
        print("YES")
    elif not e and not w:
        print("YES")
    else:
        print("NO")

else:
    print("NO")

S = input()

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

home = False
if n and s:
    if e and w:
        print("Yes")
    elif not e and not w:
        print("Yes")
    else:
        print("No")

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

else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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")


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")


S = input()
d = {}
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'

S = input()
d = {}

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")


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
if ("N" in s and "S" not in s) or
	("S" in s and "N" not in s) or
	("E" in s and "W" not in s) or
    ("W" in s and "E" not in s):
      print("No")
else:
  print("Yes")

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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")

N = input()
NS = set(N)
if len(N) == 1 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")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
#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")

#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")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()

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


s = input()

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
print("No" if (s.count("N") == 0 and s.count("S") > 0)\
		or (s.count("S") == 0 and s.count("N") > 0)\
		or (s.count("W") == 0 and s.count("E") > 0)\
		or (s.count("E") == 0 and s.count("W") > 0)\
		else "Yes")


S = input()
print("No" if(s.count("N") == 0 and s.count("S") > 0)\
		or (s.count("S") == 0 and s.count("N") > 0)\
		or (s.count("W") == 0 and s.count("E") > 0)\
		or (s.count("E") == 0 and s.count("W") > 0)\
		else "Yes")


s = input()
print("No" if (s.count("N") == 0 and s.count("S") > 0)\
		   or (s.count("S") == 0 and s.count("N") > 0)\
	       or (s.count("W") == 0 and s.count("E") > 0)\
		   or (s.count("E") == 0 and s.count("W") > 0)\
		   else "Yes")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys

s = input()

if s.find('N') != -1:
    if s.find('S') == -1:
        print('NO')
        sys.exit()

if s.find('S') != -1:
    if s.find('N') == -1:
        print('NO')
        sys.exit()

if s.find('W') != -1:
    if s.find('E') == -1:
        print('NO')
        sys.exit()

if s.find('E') != -1:
    if s.find('W') == -1:
        print('NO')
        sys.exit()
        
print('YES')


import sys

s = input()

if s.find('N') != -1:
    if s.find('S') == -1:
        print('No')
        sys.exit()

if s.find('S') != -1:
    if s.find('N') == -1:
        print('No')
        sys.exit()

if s.find('W') != -1:
    if s.find('E') == -1:
        print('No')
        sys.exit()

if s.find('E') != -1:
    if s.find('W') == -1:
        print('No')
        sys.exit()
        
print('Yes')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
if ~("N" in s ^ "S" in s) and ~("E" in s ^ "W" in s):
  print("Yes")
else:
  print("No")

s = input()
b, c = 0, 0
if "N" in s and "S" in s:
  b = 1
elif "N" not in s and "S" not in s:
  b = 1
if "E" in s and "W" in s:
  c = 1
elif "E" not in s and "W" not in s:
  c = 1
if b and c:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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')


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')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = list(input())

if S.count('S')!=0 and S.count('N')== 0:
  print('NO')
elif S.count('N')!=0 and S.count('S')== 0:
  print('NO')
elif S.count('E')!=0 and S.count('W')== 0:
  print('NO')
elif S.count('W')!=0 and S.count('S')== 0:
  print('NO')
else:
  print('YES')

S = list(input())

if S.count('S')!=0 and S.count('N')== 0:
  print('NO')
elif S.count('N')!=0 and S.count('S')== 0:
  print('NO')
elif S.count('E')!=0 and S.count('W')== 0:
  print('NO')
elif S.count('W')!=0 and S.count('E')== 0:
  print('NO')
else:
  print('YES')

S = list(input())

if S.count('S')!=0 and S.count('N')== 0:
  print('No')
elif S.count('N')!=0 and S.count('S')== 0:
  print('No')
elif S.count('E')!=0 and S.count('W')== 0:
  print('No')
elif S.count('W')!=0 and S.count('E')== 0:
  print('No')
else:
  print('Yes')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s=set;print("YNeos"[s(input())in map(s,"NS","EW","NSEW")::2])

print("NYoe s"[set(input())in map(set,["NS","EW","NSEW"])::2])

Verdicts: Runtime Error

Accepted