node_ids listlengths 4 1.4k | edge_index listlengths 1 2.22k | text listlengths 4 1.4k | source stringlengths 14 427k |
|---|---|---|---|
[
7,
0,
13,
4,
13,
4,
13,
14,
40,
2,
4,
13,
13,
17,
17,
4,
13,
17,
14,
2,
2,
2,
2,
2,
17,
13,
40,
2,
17,
13,
2,
2,
17,
13,
40,
2,
17,
13,
2,
2,
17,
13,
40,
2,
17,
13,
2,
2,
17,
13,
40,
2,
17,
13,
4,
13,
17,... | [
[
61,
2
],
[
62,
12
],
[
62,
25
],
[
62,
29
],
[
62,
33
],
[
62,
37
],
[
62,
41
],
[
62,
45
],
[
62,
49
],
[
62,
53
],
[
61,
62
]
] | [
"#!/usr/bin/env python3\n\nS = set(input())\n\nif len(S) % 2 != 0:\n print(\"No\")\nelif (\"N\" in S and not \"S\" in S) or (\"S\" in S and not \"N\" in S) or (\"W\" in S and not \"E\" in S) or (\"E\" in S and not \"W\" in S):\n print(\"No\")\nelse:\n print(\"Yes\")\n\n\n\n\n",
"S = set(input())",
"S",... | #!/usr/bin/env python3
S = set(input())
if len(S) % 2 != 0:
print("No")
elif ("N" in S and not "S" in S) or ("S" in S and not "N" in S) or ("W" in S and not "E" in S) or ("E" in S and not "W" in S):
print("No")
else:
print("Yes")
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
8,
2,
17,
13,
4,
18,
13,
13,
17,
17,
0,
13,
8,
2,
17,
13,
4,
18,
13,
13,
17,
17,
0,
13,
8,
2,
17,
13,
4,
18,
13,
13,
17,
17,
0,
13,
8,
2,
17,
13,
4,
18,
13,
13,
1... | [
[
103,
2
],
[
106,
6
],
[
104,
9
],
[
109,
11
],
[
107,
15
],
[
104,
15
],
[
107,
18
],
[
104,
18
],
[
97,
23
],
[
107,
27
],
[
104,
27
],
[
107,
30
],
[
104,
30
... | [
"s = input()\n\ns = list(s)\nsowth = s.count('S') if 'S' in s else 0\neast = s.count('E') if 'E' in s else 0\nnorth = s.count('N') if 'N' in s else 0\nwest = s.count('W') if 'W' in s else 0\n\nif (sowth != 0 and north == 0) or\\\n (sowth == 0 and north != 0) or\\\n (west != 0 and east == 0) or\\\n (west ... | s = input()
s = list(s)
sowth = s.count('S') if 'S' in s else 0
east = s.count('E') if 'E' in s else 0
north = s.count('N') if 'N' in s else 0
west = s.count('W') if 'W' in s else 0
if (sowth != 0 and north == 0) or\
(sowth == 0 and north != 0) or\
(west != 0 and east == 0) or\
(west == 0 and east != 0)... |
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
4,
13,
0,
13,
17,
15,
13,
0,
13,
4,
18,
13,
13,
13,
14,
2,
2,
2,
18,
13,
17,
18,
13,
17,
17,
2,
2,
18,
13,
17,
18,
13,
17,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
... | [
[
50,
2
],
[
59,
12
],
[
53,
17
],
[
51,
22
],
[
54,
28
],
[
54,
31
],
[
54,
37
],
[
54,
40
],
[
56,
44
],
[
57,
48
],
[
60,
48
],
[
50,
51
],
[
53,
54
],
[
... | [
"s = list(set(list(input())))\nans = \"Yes\"\n\nimport collections\nc = collections.Counter(s)\n\nif c[\"N\"] + c[\"S\"] == 1 or c[\"W\"] + c[\"E\"] == 1:\n ans = \"No\"\n \nprint(ans)",
"s = list(set(list(input())))",
"s",
"list(set(list(input())))",
"list",
"set(list(input()))",
"set",
"list(i... | s = list(set(list(input())))
ans = "Yes"
import collections
c = collections.Counter(s)
if c["N"] + c["S"] == 1 or c["W"] + c["E"] == 1:
ans = "No"
print(ans) |
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
2,
13,
17,
2,
13,
17,
2,
2,
13,
17,
2,
13,... | [
[
78,
2
],
[
84,
6
],
[
79,
9
],
[
81,
13
],
[
79,
16
],
[
72,
20
],
[
79,
23
],
[
75,
27
],
[
79,
30
],
[
85,
39
],
[
82,
42
],
[
85,
46
],
[
82,
49
],
[
7... | [
"st = input() \nn = st.count('N') \ns = st.count('S') \ne = st.count('E') \nw = st.count('W') \n\nif (n>0 and s==0) or (n==0 and s>0) or (w==0 and e>0) or (e==0 and w>0): \n print(\"No\") \nelse:\n print(\"Yes\") ",
"st = input()",
"st",
"input()",
"input",
"n = st.count('N')",
"n",
"st.count('N')",... | st = input()
n = st.count('N')
s = st.count('S')
e = st.count('E')
w = st.count('W')
if (n>0 and s==0) or (n==0 and s>0) or (w==0 and e>0) or (e==0 and w>0):
print("No")
else:
print("Yes") |
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
2,
2,
2,
2,
40,
13,
17,
40,
13,
17,
2,
13,
17,
2,
13,
17,
2,
2,
2,
40,
13,
1... | [
[
88,
2
],
[
100,
6
],
[
89,
9
],
[
91,
13
],
[
89,
16
],
[
94,
20
],
[
89,
23
],
[
97,
27
],
[
89,
30
],
[
101,
40
],
[
95,
43
],
[
92,
46
],
[
98,
49
],
[
... | [
"t=input()\nn=t.count(\"N\")\nw=t.count(\"W\")\ns=t.count(\"S\")\ne=t.count(\"E\")\nif ((n>=1 and s>=1 and w==0 and e==0) or (w>=1 and e>=1 and n==0 and s==0) or (n>=1 and s>=1 and w>=1 and e>=1)):\n print(\"Yes\")\nelse:\n print(\"No\")",
"t=input()",
"t",
"input()",
"input",
"n=t.count(\"N\")",
... | t=input()
n=t.count("N")
w=t.count("W")
s=t.count("S")
e=t.count("E")
if ((n>=1 and s>=1 and w==0 and e==0) or (w>=1 and e>=1 and n==0 and s==0) or (n>=1 and s>=1 and w>=1 and e>=1)):
print("Yes")
else:
print("No") |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
44,
2
],
[
45,
11
],
[
45,
18
],
[
45,
26
],
[
45,
33
],
[
44,
45
]
] | [
"s = input()\nif (s.count('N')>0)^(s.count('S')>0) or (s.count('E')>0)^(s.count('W')>0):\n print('No')\nelse:\n print('Yes')",
"s = input()",
"s",
"input()",
"input",
"if (s.count('N')>0)^(s.count('S')>0) or (s.count('E')>0)^(s.count('W')>0):\n print('No')\nelse:\n print('Yes')",
"(s.count('... | s = input()
if (s.count('N')>0)^(s.count('S')>0) or (s.count('E')>0)^(s.count('W')>0):
print('No')
else:
print('Yes') |
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
40,
2,
13,
13,
17,
2,
2,
13,
13,
17,
4,
13,
17,
4,
13,
14,
2,
40,
2,
13,
13,
... | [
[
80,
2
],
[
71,
6
],
[
81,
9
],
[
74,
13
],
[
81,
16
],
[
77,
20
],
[
81,
23
],
[
83,
27
],
[
81,
30
],
[
72,
37
],
[
75,
38
],
[
72,
42
],
[
75,
43
],
[
7... | [
"s = input()\nkita = s.count(\"N\")\nmina = s.count(\"S\")\nnisi = s.count(\"W\")\nhiga = s.count(\"E\")\n\nif kita + mina != 0 and kita*mina == 0:\n print(\"No\")\n exit()\nif nisi + higa != 0 and nisi*higa == 0:\n print(\"No\")\n exit()\n\nprint(\"Yes\")",
"s = input()",
"s",
"input()",
"input... | s = input()
kita = s.count("N")
mina = s.count("S")
nisi = s.count("W")
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") |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
17,
0,
13,
18,
4,
13,
39,
17,
0,
13,
39,
17,
17,
17,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
17,
0,
18,
13,
17,
17,
14,
2,
18,
13,
13,
17,
0,
18,
13,
17,
... | [
[
152,
4
],
[
155,
11
],
[
158,
14
],
[
153,
17
],
[
149,
21
],
[
29,
28
],
[
159,
33
],
[
159,
37
],
[
28,
38
],
[
44,
41
],
[
150,
42
],
[
159,
48
],
[
28,
49
]... | [
"import sys\n\ninput = sys.stdin.readline\nMOD = 1000000007\n\nS = input()[:-1]\n\nx = [0,0,0,0]\n\nfor i in range(len(S)):\n if S[i] == 'N':\n x[0]+=1\n if S[i] == 'S':\n x[1]+=1\n if S[i] == 'E':\n x[2]+=1\n if S[i] == 'W':\n x[3]+=1\n\n\nif x.count(0) == 0:\n print(\"Ye... | import sys
input = sys.stdin.readline
MOD = 1000000007
S = input()[:-1]
x = [0,0,0,0]
for i in range(len(S)):
if S[i] == 'N':
x[0]+=1
if S[i] == 'S':
x[1]+=1
if S[i] == 'E':
x[2]+=1
if S[i] == 'W':
x[3]+=1
if x.count(0) == 0:
print("Yes")
exit()
else:
if... |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
2,
17,
13,
2,
17,
13,
4,
13,
17,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
40,
2,
17,
13,
40,
2,
17,
13,
4,
13,
17,
14,
2,
2,
2,
40,
2,
17,
13,
40,
2,
17,
13,
... | [
[
70,
2
],
[
71,
11
],
[
71,
14
],
[
71,
17
],
[
71,
20
],
[
71,
30
],
[
71,
33
],
[
71,
37
],
[
71,
41
],
[
71,
52
],
[
71,
56
],
[
71,
59
],
[
71,
62
],
[
... | [
"s = input()\nif 'W' in s and 'E' in s and 'N' in s and 'S' in s:\n print('Yes')\nelif 'W' in s and 'E' in s and not 'N' in s and not 'S' in s:\n print('Yes')\nelif not 'W' in s and not 'E' in s and 'N' in s and 'S' in s:\n print('Yes')\nelse:\n print('No')",
"s = input()",
"s",
"input()",
"inpu... | s = input()
if 'W' in s and 'E' in s and 'N' in s and 'S' in s:
print('Yes')
elif 'W' in s and 'E' in s and not 'N' in s and not 'S' in s:
print('Yes')
elif not 'W' in s and not 'E' in s and 'N' in s and 'S' in s:
print('Yes')
else:
print('No')
|
[
7,
12,
13,
15,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
15,
15,
15,
15,
15,
13,
0,
13,
4,
18,
4,
13,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
14,
2,
2,
2,
17,
13,
2,
17... | [
[
7,
6
],
[
27,
26
],
[
6,
30
],
[
26,
37
],
[
26,
40
],
[
26,
44
],
[
26,
47
],
[
26,
53
],
[
26,
56
],
[
26,
60
],
[
26,
63
],
[
80,
77
]
] | [
"def main():\n import sys\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n from itertools import combinations, permutations, accumulate, groupby, product\n from bisect import bisect_left,bisect_right\n from heapq import heapify, heappop, hea... | def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
im... |
[
7,
0,
13,
4,
13,
0,
13,
17,
13,
17,
0,
13,
13,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
40,
2,
17,
13,
40,
2,
17,
13,
4,
13,
17,
4,
13,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
40,
2,
17,
13,
40,
2,
17,
13,
4,
13,
17... | [
[
119,
2
],
[
110,
6
],
[
122,
8
],
[
104,
11
],
[
120,
12
],
[
105,
19
],
[
105,
22
],
[
105,
26
],
[
105,
30
],
[
105,
42
],
[
105,
45
],
[
105,
49
],
[
105,
53
... | [
"s=input()\nx,y=0,0\nli=s\nif 'N' in li and 'S' in li and not 'E' in li and not 'W' in li:\n print('Yes')\n exit()\n \nif 'E' in li and 'W' in li and not 'S' in li and not 'N' in li:\n print('Yes')\n exit()\n \nfor i in s:\n if(i=='N'):\n y+=1\n elif(i=='S'):\n y-=1\n elif(i=='W'):\n ... | s=input()
x,y=0,0
li=s
if 'N' in li and 'S' in li and not 'E' in li and not 'W' in li:
print('Yes')
exit()
if 'E' in li and 'W' in li and not 'S' in li and not 'N' in li:
print('Yes')
exit()
for i in s:
if(i=='N'):
y+=1
elif(i=='S'):
y-=1
elif(i=='W'):
x-=1
else:
... |
[
7,
15,
13,
0,
13,
4,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
4,
18,
13,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
4,
18,
13,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
4,
18,
13,
13,
14,
2,
17,
... | [
[
71,
4
],
[
72,
10
],
[
72,
14
],
[
72,
25
],
[
72,
29
],
[
72,
40
],
[
72,
44
],
[
72,
55
],
[
72,
59
],
[
71,
72
]
] | [
"import sys\ns = input()\nif 'N' in s:\n if 'S' not in s:\n print('No')\n sys.exit()\nif 'W' in s:\n if 'E' not in s:\n print('No')\n sys.exit()\nif 'E' in s:\n if 'W' not in s:\n print('No')\n sys.exit()\nif 'S' in s:\n if 'N' not in s:\n print('No')\n ... | import sys
s = input()
if 'N' in s:
if 'S' not in s:
print('No')
sys.exit()
if 'W' in s:
if 'E' not in s:
print('No')
sys.exit()
if 'E' in s:
if 'W' not in s:
print('No')
sys.exit()
if 'S' in s:
if 'N' not in s:
print('No')
sys.exit()
print... |
[
7,
15,
0,
13,
4,
13,
0,
13,
4,
13,
13,
28,
13,
13,
0,
18,
13,
13,
17,
14,
2,
40,
18,
13,
17,
18,
13,
17,
40,
18,
13,
17,
18,
13,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13
] | [
[
45,
3
],
[
42,
7
],
[
13,
12
],
[
46,
12
],
[
18,
15
],
[
43,
16
],
[
12,
17
],
[
43,
23
],
[
43,
26
],
[
43,
30
],
[
43,
33
],
[
42,
43
],
[
45,
46
]
] | [
"from collections import defaultdict\n\nS = input()\ndic = defaultdict(bool)\nfor s in S:\n dic[s] = True\nif dic[\"N\"] != dic[\"S\"] or dic[\"W\"] != dic[\"E\"]:\n print(\"No\")\nelse:\n print(\"Yes\")",
"from collections import defaultdict",
"S = input()",
"S",
"input()",
"input",
"dic = def... | from collections import defaultdict
S = input()
dic = defaultdict(bool)
for s in S:
dic[s] = True
if dic["N"] != dic["S"] or dic["W"] != dic["E"]:
print("No")
else:
print("Yes")
|
[
7,
0,
13,
4,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
13,
... | [
[
72,
2
],
[
69,
6
],
[
73,
11
],
[
73,
15
],
[
75,
17
],
[
73,
22
],
[
73,
26
],
[
66,
28
],
[
73,
33
],
[
73,
37
],
[
78,
39
],
[
73,
44
],
[
73,
48
],
[
... | [
"s=input()\nres = ''\nif 'N' in s:\n if 'S' not in s:\n res = 'No'\nif 'S' in s:\n if 'N' not in s:\n res = 'No'\nif 'E' in s:\n if 'W' not in s:\n res = 'No'\nif 'W' in s:\n if 'E' not in s:\n res = 'No'\nif res == '':\n print('Yes')\nelse:\n print(res)\n",
"s=input(... | s=input()
res = ''
if 'N' in s:
if 'S' not in s:
res = 'No'
if 'S' in s:
if 'N' not in s:
res = 'No'
if 'E' in s:
if 'W' not in s:
res = 'No'
if 'W' in s:
if 'E' not in s:
res = 'No'
if res == '':
print('Yes')
else:
print(res)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
14,
2,
2,
13,
13,
2,
13,
13,
0,
13,
17,
4,
13,
13,
10,
2,
13,
10,
2,
13,
10,
17,
13,
10,
4,
13,
10,
2,
1... | [
[
52,
2
],
[
58,
6
],
[
55,
9
],
[
53,
12
],
[
61,
14
],
[
53,
17
],
[
46,
19
],
[
53,
22
],
[
43,
24
],
[
53,
27
],
[
56,
31
],
[
44,
32
],
[
62,
34
],
[
4... | [
"s = input()\nans = 'Yes'\ncn = 'N' in s\nce = 'E' in s\ncw = 'W' in s\ncs = 'S' in s\nif (cn ^ cs) or (ce ^ cw):\n ans = 'No'\nprint(ans)",
"s = input()",
"s",
"input()",
"input",
"ans = 'Yes'",
"ans",
"'Yes'",
"cn = 'N' in s",
"cn",
"'N' in s",
"'N'",
"s",
"ce = 'E' in s",
"ce",
"... | s = input()
ans = 'Yes'
cn = 'N' in s
ce = 'E' in s
cw = 'W' in s
cs = 'S' in s
if (cn ^ cs) or (ce ^ cw):
ans = 'No'
print(ans) |
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
14,
2,
2,
2,
17,
13,
40,
2,
17,
13,
2,
2,
17,
13,
40,
2,
17,
13,
14,
2,
2,
2,
17,
13,
40,
2,
17,
13,
2,
2,
17,
13,
40,
2,
17,
13,
14,
2,
2,
2,
2,
17,
13,
... | [
[
124,
2
],
[
127,
6
],
[
139,
9
],
[
118,
12
],
[
125,
19
],
[
125,
23
],
[
125,
27
],
[
125,
31
],
[
125,
37
],
[
125,
41
],
[
125,
45
],
[
125,
49
],
[
125,
56
... | [
"string = input()\n\nc1 = True\nc2 = True\nc3 = True\n\nif (\"W\" in string and not(\"E\" in string)) or \"E\" in string and not(\"W\" in string): c1 = False\n \nif (\"N\" in string and not(\"S\" in string)) or \"S\" in string and not(\"N\" in string): c2 = False\n\nif \"N\" in string and \"S\" in string and \"E... | 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... |
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
... | [
[
78,
2
],
[
102,
6
],
[
79,
9
],
[
90,
13
],
[
79,
16
],
[
96,
20
],
[
79,
23
],
[
99,
27
],
[
79,
30
],
[
75,
34
],
[
103,
38
],
[
93,
41
],
[
91,
45
],
[
... | [
"S = input()\n\nn = S.count('N')\ns = S.count('S')\nw = S.count('W')\ne = S.count('E')\na = 0\n\nif n > 0:\n a += 1\nif s > 0:\n a -= 1\nif w > 0:\n a += 2\nif e > 0:\n a -= 2\n\nif a == 0:\n print(\"Yes\")\nelse:\n print(\"No\")",
"S = input()",
"S",
"input()",
"input",
"n = S.count('N'... | 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
if s > 0:
a -= 1
if w > 0:
a += 2
if e > 0:
a -= 2
if a == 0:
print("Yes")
else:
print("No")
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
2,
13,
17,
2,
13,
17,
0,
13,
17,
14,
2,
2,
13,
17,
2,
13,
... | [
[
87,
2
],
[
84,
8
],
[
75,
11
],
[
88,
14
],
[
78,
18
],
[
88,
21
],
[
72,
25
],
[
88,
28
],
[
90,
32
],
[
88,
35
],
[
76,
41
],
[
79,
44
],
[
81,
47
],
[
... | [
"S = list(input())\n\nres = True\n\nn = S.count(\"N\")\ns = S.count(\"S\")\nw = S.count(\"W\")\ne = S.count(\"E\")\n\nif (n > 0) ^ (s > 0):\n res = False\n\nif (w > 0) ^ (e > 0):\n res = False\n\nif res:\n print(\"Yes\")\nelse:\n print(\"No\")\n",
"S = list(input())",
"S",
"list(input())",
"list... | S = list(input())
res = True
n = S.count("N")
s = S.count("S")
w = S.count("W")
e = S.count("E")
if (n > 0) ^ (s > 0):
res = False
if (w > 0) ^ (e > 0):
res = False
if res:
print("Yes")
else:
print("No")
|
[
7,
0,
13,
4,
13,
4,
13,
14,
2,
2,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
4,
13,
17,
14,
2,
2,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,... | [
[
116,
2
],
[
117,
14
],
[
117,
21
],
[
117,
28
],
[
117,
35
],
[
117,
49
],
[
117,
56
],
[
117,
63
],
[
117,
70
],
[
117,
84
],
[
117,
91
],
[
117,
98
],
[
117,
10... | [
"N = str(input())\n\nif N.count(\"N\") > 0 and N.count(\"W\") > 0 and N.count(\"S\") > 0 and N.count(\"E\") > 0:\n print(\"Yes\")\nelif N.count(\"N\") > 0 and N.count(\"W\") == 0 and N.count(\"S\") > 0 and N.count(\"E\") == 0:\n print(\"Yes\")\nelif N.count(\"N\") == 0 and N.count(\"W\") > 0 and N.count(\"S\"... | N = str(input())
if N.count("N") > 0 and N.count("W") > 0 and N.count("S") > 0 and N.count("E") > 0:
print("Yes")
elif N.count("N") > 0 and N.count("W") == 0 and N.count("S") > 0 and N.count("E") == 0:
print("Yes")
elif N.count("N") == 0 and N.count("W") > 0 and N.count("S") == 0 and N.count("E") > 0:
prin... |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
4,
13,
17,
14,
2,
2,
2,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
... | [
[
114,
2
],
[
115,
12
],
[
115,
19
],
[
115,
26
],
[
115,
33
],
[
115,
47
],
[
115,
54
],
[
115,
61
],
[
115,
68
],
[
115,
82
],
[
115,
89
],
[
115,
96
],
[
115,
10... | [
"S = input()\n\nif S.count('N') >= 1 and S.count('S') >= 1 and S.count('E') == 0 and S.count('W') == 0:\n print('Yes')\nelif S.count('E') >= 1 and S.count('W') >= 1 and S.count('N') == 0 and S.count('S') == 0:\n print('Yes')\nelif S.count('E') >= 1 and S.count('W') >= 1 and S.count('N') >= 1 and S.count('S') >= 1... | S = input()
if S.count('N') >= 1 and S.count('S') >= 1 and S.count('E') == 0 and S.count('W') == 0:
print('Yes')
elif S.count('E') >= 1 and S.count('W') >= 1 and S.count('N') == 0 and S.count('S') == 0:
print('Yes')
elif S.count('E') >= 1 and S.count('W') >= 1 and S.count('N') >= 1 and S.count('S') >= 1:
print('... |
[
7,
15,
13,
12,
13,
29,
4,
18,
4,
18,
18,
13,
13,
13,
13,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
22,
17,
17,
12,
13,
28,
13,
13,
0,
18,
13,
13,
17,
14,
40,
18,
13,
17,
18,
13,
17,
29,
17,
14,
40,
18,
13,... | [
[
80,
16
],
[
34,
33
],
[
63,
33
],
[
39,
36
],
[
81,
37
],
[
33,
38
],
[
81,
43
],
[
81,
46
],
[
81,
53
],
[
81,
56
],
[
63,
63
],
[
77,
65
],
[
84,
67
],
[
... | [
"import sys\ndef input():\n return sys.stdin.readline().rstrip()\n\nma={\"N\":0,\"S\":0,\"E\":0,\"W\":0}\n\ndef func(S):\n for x in S:\n ma[x]=1\n if ma[\"N\"]!=ma[\"S\"]:\n return False\n if ma[\"W\"]!=ma[\"E\"]:\n return False\n return True\n\nS=input()\nprint(\"Yes\" if func(S) else \"No\")",
"im... | import sys
def input():
return sys.stdin.readline().rstrip()
ma={"N":0,"S":0,"E":0,"W":0}
def func(S):
for x in S:
ma[x]=1
if ma["N"]!=ma["S"]:
return False
if ma["W"]!=ma["E"]:
return False
return True
S=input()
print("Yes" if func(S) else "No")
|
[
7,
15,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
17,
0,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
17,
... | [
[
114,
4
],
[
102,
13
],
[
108,
22
],
[
105,
38
],
[
99,
43
],
[
111,
47
],
[
100,
50
],
[
112,
55
],
[
112,
58
],
[
112,
64
],
[
112,
67
],
[
112,
77
],
[
112,
80
... | [
"import sys\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nread = sys.stdin.buffer.read\nsys.setrecursionlimit(10 ** 7)\nINF = float('inf')\n\nS = input()\nsS = set(S)\nif \"N\" in sS or \"S\" in sS:\n if not (\"N\" in sS and \"S\" in sS):\n print('No')\n quit()\nif ... | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
S = input()
sS = set(S)
if "N" in sS or "S" in sS:
if not ("N" in sS and "S" in sS):
print('No')
quit()
if "W" in sS or "E" in sS:
... |
[
7,
0,
13,
4,
13,
0,
13,
2,
39,
17,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
2,
18,
13,
13,
17,
2,
18,
13,
17,
17,
0,
18,
13,
17,
17,
14,
2,
2,
18,
13,
13,
17,
2,
18,
13,
17,
17,
0,
18,
13,
17,
17,
14,
2,
2,
18,... | [
[
112,
2
],
[
109,
6
],
[
13,
12
],
[
113,
17
],
[
113,
22
],
[
12,
23
],
[
110,
27
],
[
34,
31
],
[
110,
32
],
[
113,
39
],
[
12,
40
],
[
110,
44
],
[
51,
48
],
... | [
"s = input()\n\ncheck = [0]*4\n\nfor i in range(len(s)):\n if s[i] == \"N\" and check[0] == 0:\n check[0] = 1\n if s[i] == \"S\" and check[1] == 0:\n check[1] = 1\n if s[i] == \"W\" and check[2] == 0:\n check[2] = 1\n if s[i] == \"E\" and check[3] == 0:\n check[3] = 1\nif che... | s = input()
check = [0]*4
for i in range(len(s)):
if s[i] == "N" and check[0] == 0:
check[0] = 1
if s[i] == "S" and check[1] == 0:
check[1] = 1
if s[i] == "W" and check[2] == 0:
check[2] = 1
if s[i] == "E" and check[3] == 0:
check[3] = 1
if check[0] == check[1] and chec... |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
2,
2,
2,
17,
13,
40,
17,
13,
2,
2,
17,
13,
40,
17,
13,
2,
2,
17,
13,
40,
17,
13,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13
] | [
[
51,
2
],
[
54,
8
],
[
52,
11
],
[
55,
19
],
[
55,
22
],
[
55,
26
],
[
55,
29
],
[
55,
33
],
[
55,
36
],
[
55,
40
],
[
55,
43
],
[
51,
52
],
[
54,
55
]
] | [
"s = list(input())\nss = set(s)\nif ((\"W\" in ss and \"E\" not in ss) or (\"S\" in ss and \"N\" not in ss) \n or (\"E\" in ss and \"W\" not in ss) or (\"N\" in ss and \"S\" not in ss)):\n print(\"No\")\nelse:\n print(\"Yes\")",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"inp... | s = list(input())
ss = set(s)
if (("W" in ss and "E" not in ss) or ("S" in ss and "N" not in ss)
or ("E" in ss and "W" not in ss) or ("N" in ss and "S" not in ss)):
print("No")
else:
print("Yes") |
[
7,
15,
13,
13,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
12,
13,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,... | [
[
26,
25
],
[
168,
31
],
[
35,
35
],
[
146,
44
],
[
152,
49
],
[
161,
57
],
[
171,
59
],
[
137,
61
],
[
162,
64
],
[
149,
68
],
[
162,
71
],
[
143,
75
],
[
162,
78
... | [
"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log\nfrom itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby\nfrom operator import ... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgette... |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
28,
2
],
[
29,
10
],
[
29,
13
],
[
29,
17
],
[
29,
20
],
[
28,
29
]
] | [
"S =input()\nif (('N' in S) == ('S' in S)) and (('W' in S) == ('E' in S)):\n print('Yes')\nelse:\n print('No')",
"S =input()",
"S",
"input()",
"input",
"if (('N' in S) == ('S' in S)) and (('W' in S) == ('E' in S)):\n print('Yes')\nelse:\n print('No')",
"(('N' in S) == ('S' in S)) and (('W' i... | S =input()
if (('N' in S) == ('S' in S)) and (('W' in S) == ('E' in S)):
print('Yes')
else:
print('No')
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
14,
2,
2,
17... | [
[
75,
2
],
[
87,
8
],
[
76,
13
],
[
78,
15
],
[
88,
21
],
[
76,
21
],
[
88,
25
],
[
76,
25
],
[
81,
27
],
[
88,
33
],
[
76,
33
],
[
88,
37
],
[
76,
37
],
[
... | [
"s = list(input())\ns = list(set(s))\nflag = True\nif \"N\" in s and not \"S\" in s:\n flag = False\nif \"S\" in s and not \"N\" in s:\n flag = False\nif \"E\" in s and not \"W\" in s:\n flag = False\nif \"W\" in s and not \"E\" in s:\n flag = False\nprint(\"Yes\" if flag else \"No\")",
"s = list(inpu... | s = list(input())
s = list(set(s))
flag = True
if "N" in s and not "S" in s:
flag = False
if "S" in s and not "N" in s:
flag = False
if "E" in s and not "W" in s:
flag = False
if "W" in s and not "E" in s:
flag = False
print("Yes" if flag else "No") |
[
7,
0,
13,
4,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
17,
... | [
[
61,
2
],
[
62,
8
],
[
62,
12
],
[
62,
21
],
[
62,
25
],
[
62,
34
],
[
62,
38
],
[
62,
47
],
[
62,
51
],
[
61,
62
]
] | [
"s = input()\nif \"N\" in s:\n if \"S\" not in s :\n print(\"No\")\n exit()\nif \"E\" in s:\n if \"W\" not in s:\n print(\"No\")\n exit()\nif \"S\" in s:\n if \"N\" not in s :\n print(\"No\")\n exit()\nif \"W\" in s:\n if \"E\" not in s:\n print(\"No\")\n exit()\nprint(\"Yes\")",
"s = ... | 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") |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
39,
4,
18,
13,
13,
17,
4,
18,
13,
13,
17,
13,
0,
13,
4,
13,
39,
4,
18,
13,
13,
17,
4,
18,
13,
13,
17,
13,
0,
13,
39,
17,
17,
0,
13,
17,
14,
2,
2,
13,
13,
2,
2,
13,
13,
17,
0,
... | [
[
86,
2
],
[
92,
6
],
[
87,
12
],
[
87,
17
],
[
92,
20
],
[
101,
22
],
[
87,
28
],
[
87,
33
],
[
101,
36
],
[
113,
38
],
[
107,
43
],
[
84,
48
],
[
93,
49
],
[
... | [
"s = input()\nkita, minami = sorted([s.count('N'),s.count('S')])\nnisi, higasi = sorted([s.count('W'),s.count('E')])\nresult = ['No','Yes']\nr = 1\nif kita==minami or kita*minami > 0:\n r *= 1\nelse:\n r = 0\n\nif nisi==higasi or nisi*higasi > 0:\n r *= 1\nelse:\n r = 0\nprint(result[r])",
"s = input(... | s = input()
kita, minami = sorted([s.count('N'),s.count('S')])
nisi, higasi = sorted([s.count('W'),s.count('E')])
result = ['No','Yes']
r = 1
if kita==minami or kita*minami > 0:
r *= 1
else:
r = 0
if nisi==higasi or nisi*higasi > 0:
r *= 1
else:
r = 0
print(result[r]) |
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
4,
13,
4,
13,
13,
28,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
17,
0,
13,
17,
4,
... | [
[
83,
2
],
[
86,
6
],
[
77,
9
],
[
68,
12
],
[
84,
17
],
[
20,
19
],
[
69,
24
],
[
84,
24
],
[
69,
28
],
[
84,
28
],
[
19,
29
],
[
89,
32
],
[
69,
37
],
[
8... | [
"s = input()\nx = 0\ny = 0\ns = list(set(s))\nfor i in range(len(s)):\n if s[i] == 'N':\n y += 1\n elif s[i] == 'W':\n x -= 1\n elif s[i] == 'S':\n y -= 1\n else:\n x += 1\nprint('Yes' if x == 0 and y == 0 else 'No')",
"s = input()",
"s",
"input()",
"input",
"x = 0"... | s = input()
x = 0
y = 0
s = list(set(s))
for i in range(len(s)):
if s[i] == 'N':
y += 1
elif s[i] == 'W':
x -= 1
elif s[i] == 'S':
y -= 1
else:
x += 1
print('Yes' if x == 0 and y == 0 else 'No')
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
42,
2,
13,
17,
14,
2,
17,
13,
14,
2,
17,
13,
0,
13,
17,
4,
13,
17,
3,
14,
2,
17,
13,
14,
2,
17,
13,
0,
13,
17,
4,
13,
17,
3,
14,
2,
17,
13,
14,
2,
17,
13,
0,
... | [
[
84,
2
],
[
87,
6
],
[
85,
9
],
[
93,
11
],
[
94,
15
],
[
82,
15
],
[
91,
15
],
[
100,
15
],
[
97,
15
],
[
88,
20
],
[
85,
20
],
[
88,
24
],
[
85,
24
],
[
... | [
"S = input()\nS = list(S)\ncount = 0\nwhile count == 0:\n if 'N' in S:\n if'S' in S:\n count += 1\n else:\n print('No')\n break\n if 'S' in S:\n if'N' in S:\n count += 1\n else:\n print('No')\n break\n if 'E' in S:\n if'W' in S:\n count += 1\n else:\n pri... | S = input()
S = list(S)
count = 0
while count == 0:
if 'N' in S:
if'S' in S:
count += 1
else:
print('No')
break
if 'S' in S:
if'N' in S:
count += 1
else:
print('No')
break
if 'E' in S:
if'W' in S:
count += 1
else:
print('No')
break
if... |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
18,
4,
13,
13,
14,
2,
2,
2,
17,
13,
40,
17,
13,
2,
40,
17,
13,
2,
17,
13,
4,
13,
17,
4,
18,
13,
13,
17,
14,
2,
2,
2,
17,
13,
40,
17,... | [
[
79,
4
],
[
76,
18
],
[
80,
22
],
[
77,
29
],
[
77,
32
],
[
77,
36
],
[
77,
39
],
[
77,
53
],
[
77,
56
],
[
77,
60
],
[
77,
63
],
[
76,
77
],
[
79,
80
]
] | [
"import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10 ** 7)\n\ns = input().strip()\n\nif ('N' in s and 'S' not in s) or ('N' not in s and 'S' in s):\n print('No')\n sys.exit(0)\nif ('W' in s and 'E' not in s) or ('W' not in s and 'E' in s):\n print('No')\n sys.exit(0)\nprint('Yes')",
"impo... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
s = input().strip()
if ('N' in s and 'S' not in s) or ('N' not in s and 'S' in s):
print('No')
sys.exit(0)
if ('W' in s and 'E' not in s) or ('W' not in s and 'E' in s):
print('No')
sys.exit(0)
print('Yes')
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
17,
13,
2,
17,
13,
14,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
14,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
4,
13,
17,
14,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
14,
2,
2,... | [
[
83,
2
],
[
80,
6
],
[
84,
9
],
[
81,
14
],
[
81,
17
],
[
81,
22
],
[
81,
25
],
[
81,
33
],
[
81,
36
],
[
81,
47
],
[
81,
50
],
[
81,
58
],
[
81,
61
],
[
8... | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[7]:\n\n\nS = input()\n\n\n# In[8]:\n\n\ns_set = set(S)\nif \"S\" in s_set and \"N\" in s_set:\n if \"E\" in s_set and \"W\" in s_set:\n print(\"Yes\")\n elif \"E\" in s_set or \"W\" in s_set:\n print(\"No\")\n else:\n print(\"Yes\")\nelif... | #!/usr/bin/env python
# coding: utf-8
# In[7]:
S = input()
# In[8]:
s_set = set(S)
if "S" in s_set and "N" in s_set:
if "E" in s_set and "W" in s_set:
print("Yes")
elif "E" in s_set or "W" in s_set:
print("No")
else:
print("Yes")
elif "S" in s_set or "N" in s_set:
print("N... |
[
7,
12,
13,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
17,
13,
4,
13,
13,
17,
13,
4,
13,
13,
17,
13,
4,
13,
13,
17,
14,
2,
2,
2,
13,
17,
2,
13,
17,
2,
2,
13,
17,
2,
13,
17,
4,
13,... | [
[
10,
6
],
[
12,
8
],
[
10,
10
],
[
12,
12
],
[
89,
14
],
[
95,
18
],
[
81,
20
],
[
90,
21
],
[
86,
23
],
[
81,
25
],
[
90,
26
],
[
92,
28
],
[
81,
30
],
[
... | [
"def c(S, a):\n return S.count(a)\n\n\nS = input()\nn, w, s, e = c(S, 'N'), c(S, 'W'), c(S, 'S'), c(S, 'E')\nif ((n > 0 and s == 0) or (s > 0 and n == 0)):\n print('No')\nelif ((w > 0 and e == 0) or (e > 0 and w == 0)):\n print('No')\nelse:\n print('Yes')",
"def c(S, a):\n return S.count(a)",
"c"... | def c(S, a):
return S.count(a)
S = input()
n, w, s, e = c(S, 'N'), c(S, 'W'), c(S, 'S'), c(S, 'E')
if ((n > 0 and s == 0) or (s > 0 and n == 0)):
print('No')
elif ((w > 0 and e == 0) or (e > 0 and w == 0)):
print('No')
else:
print('Yes')
|
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
14,
2,
18,
13,
17,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
14,
2,
18,
1... | [
[
87,
3
],
[
90,
9
],
[
88,
12
],
[
99,
14
],
[
91,
19
],
[
91,
25
],
[
93,
29
],
[
91,
34
],
[
91,
40
],
[
96,
44
],
[
91,
49
],
[
91,
55
],
[
102,
59
],
[
... | [
"# A\nfrom collections import Counter\nS = list(input())\ncount = Counter(S)\nflag = True\n\nif count['N'] > 0:\n if count['S'] == 0:\n flag = False\nif count['S'] > 0:\n if count['N'] == 0:\n flag = False\nif count['E'] > 0:\n if count['W'] == 0:\n flag = False\nif count['W'] > 0:\n if count['E'] == 0... | # A
from collections import Counter
S = list(input())
count = Counter(S)
flag = True
if count['N'] > 0:
if count['S'] == 0:
flag = False
if count['S'] > 0:
if count['N'] == 0:
flag = False
if count['E'] > 0:
if count['W'] == 0:
flag = False
if count['W'] > 0:
if count['E'] == 0:
flag = False
pr... |
[
7,
15,
13,
12,
13,
12,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
4,
13,
15,
0,
13,
4,
13,
13,
14,
2,
2,
2,
2,
2,
18,
13,
17,
17,
40,
18,
13,
17,
17,
2,
40,
18,
13,
17,
17,
2,
18,
13,
17,
17,
2,
2,
18,
13,... | [
[
90,
15
],
[
85,
19
],
[
81,
22
],
[
91,
25
],
[
82,
33
],
[
82,
38
],
[
82,
44
],
[
82,
49
],
[
82,
55
],
[
82,
60
],
[
82,
66
],
[
82,
71
],
[
81,
82
],
[
... | [
"import sys\ndef input(): return sys.stdin.readline().strip()\ndef mapint(): return map(int, input().split())\nsys.setrecursionlimit(10**9)\n\nS = list(input())\nfrom collections import Counter\nc = Counter(S)\n\nif (c['N']==0 and c['S']!=0) or (c['N']!=0 and c['S']==0) or (c['E']==0 and c['W']!=0) or (c['E']!=0 an... | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
S = list(input())
from collections import Counter
c = Counter(S)
if (c['N']==0 and c['S']!=0) or (c['N']!=0 and c['S']==0) or (c['E']==0 and c['W']!=0) or (c['E']!=0 and c['W']==0):
... |
[
7,
0,
13,
4,
13,
0,
13,
2,
39,
17,
17,
0,
13,
4,
13,
13,
0,
13,
17,
0,
13,
39,
17,
17,
17,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
13,
0,
18,
13,
4,
18,
13,
13,
13,
17,
14,
40,
2,
18,
13,
17,
18,
13,
17,
14,
... | [
[
108,
2
],
[
99,
6
],
[
105,
12
],
[
109,
15
],
[
93,
17
],
[
84,
20
],
[
28,
27
],
[
106,
30
],
[
87,
32
],
[
109,
34
],
[
27,
35
],
[
44,
37
],
[
100,
38
],
... | [
"# coding: utf-8\n# Your code here!\n#a, b = map(int,input().split())\nS = input()\nF = [False] * 4\nn = len(S)\nflg = False\nV = [\"E\", \"W\", \"N\", \"S\"]\nfor i in range(n):\n s = S[i]\n F[V.index(s)] = True\n\nif not (F[0]^F[1]):\n if not (F[2]^F[3]):\n flg = True\na = True\nb= False\nc=False... | # coding: utf-8
# Your code here!
#a, b = map(int,input().split())
S = input()
F = [False] * 4
n = len(S)
flg = False
V = ["E", "W", "N", "S"]
for i in range(n):
s = S[i]
F[V.index(s)] = True
if not (F[0]^F[1]):
if not (F[2]^F[3]):
flg = True
a = True
b= False
c=False
if flg:
print("Yes")
else... |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
4,
13,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
14,
2,
2,
40,
17,
13,
40,
17,
13,
2,
40,
17,
13,
40,
17,
13,
4,
13,
17,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
2,
17,
1... | [
[
70,
2
],
[
67,
6
],
[
71,
9
],
[
71,
15
],
[
68,
20
],
[
71,
30
],
[
71,
33
],
[
71,
37
],
[
71,
40
],
[
71,
50
],
[
71,
53
],
[
71,
56
],
[
71,
59
],
[
6... | [
"N = input()\nNS = set(N)\nif len(N) == 1 or len(NS) == 1:\n print(\"No\")\nelif \"N\" not in N and \"S\" not in N or \"W\" not in N and \"E\" not in N :\n print(\"Yes\")\nelif \"N\" in N and \"W\" in N and \"E\" in N and \"S\" in N:\n print(\"Yes\")\nelse:\n print(\"No\")",
"N = input()",
"N",
"i... | 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") |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
2,
17,
13,
40,
2,
17,
13,
4,
13,
17,
14,
2,
2,
40,
2,
17,
13,
40,
2,
17,
13,
2,
... | [
[
70,
2
],
[
71,
10
],
[
71,
13
],
[
71,
17
],
[
71,
20
],
[
71,
29
],
[
71,
32
],
[
71,
37
],
[
71,
41
],
[
71,
51
],
[
71,
55
],
[
71,
59
],
[
71,
62
],
[
... | [
"s = input()\n\nif (\"N\" in s and \"S\" in s) and (\"W\" in s and \"E\" in s):\n print (\"Yes\")\nelif (\"N\" in s and \"S\" in s) and (not \"W\" in s and not \"E\" in s):\n print (\"Yes\")\nelif (not \"N\" in s and not \"S\" in s) and (\"W\" in s and \"E\" in s):\n print (\"Yes\")\nelse:\n print (\"No... | s = input()
if ("N" in s and "S" in s) and ("W" in s and "E" in s):
print ("Yes")
elif ("N" in s and "S" in s) and (not "W" in s and not "E" in s):
print ("Yes")
elif (not "N" in s and not "S" in s) and ("W" in s and "E" in s):
print ("Yes")
else:
print ("No")
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
2,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
2,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
2,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
2,
17,
13,
0,... | [
[
70,
2
],
[
73,
8
],
[
71,
13
],
[
71,
18
],
[
76,
20
],
[
71,
25
],
[
71,
30
],
[
82,
32
],
[
71,
37
],
[
71,
42
],
[
79,
44
],
[
71,
49
],
[
71,
54
],
[
... | [
"S = list(input())\nflag = 1\nif \"S\" in S:\n if not(\"N\" in S):\n flag = 0\nif \"N\" in S:\n if not(\"S\" in S):\n flag = 0\nif \"E\" in S:\n if not(\"W\" in S):\n flag = 0\nif \"W\" in S:\n if not(\"E\" in S):\n flag = 0\nif flag:\n print(\"Yes\")\nelse:\n print(\"No\")",
"S = list(input())"... | S = list(input())
flag = 1
if "S" in S:
if not("N" in S):
flag = 0
if "N" in S:
if not("S" in S):
flag = 0
if "E" in S:
if not("W" in S):
flag = 0
if "W" in S:
if not("E" in S):
flag = 0
if flag:
print("Yes")
else:
print("No")
|
[
7,
0,
13,
4,
13,
4,
13,
14,
2,
2,
2,
2,
2,
17,
13,
40,
17,
13,
2,
2,
17,
13,
40,
17,
13,
2,
2,
17,
13,
40,
17,
13,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
46,
2
],
[
47,
14
],
[
47,
17
],
[
47,
21
],
[
47,
24
],
[
47,
28
],
[
47,
31
],
[
47,
35
],
[
47,
38
],
[
46,
47
]
] | [
"S=list(input())\nif ('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):\n print('No') \nelse:\n print('Yes')",
"S=list(input())",
"S",
"list(input())",
"list",
"input()",
"input",
"if ('N' in S and 'S' not in S) or ('S' in S ... | S=list(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') |
[
7,
0,
13,
4,
13,
41,
28,
13,
17,
4,
13,
17,
0,
13,
13,
28,
13,
13,
0,
18,
13,
13,
17,
14,
2,
2,
2,
18,
13,
17,
17,
40,
18,
13,
17,
17,
2,
40,
18,
13,
17,
17,
2,
18,
13,
17,
17,
4,
13,
17,
14,
2,
2,
2,
18,
1... | [
[
84,
2
],
[
8,
7
],
[
7,
10
],
[
81,
13
],
[
17,
16
],
[
85,
16
],
[
22,
19
],
[
82,
20
],
[
16,
21
],
[
82,
28
],
[
82,
33
],
[
82,
39
],
[
82,
44
],
[
82... | [
"S = input()\ncount = {s: 0 for s in \"NWSE\"}\nfor s in S:\n count[s] += 1\n\nif count[\"N\"] == 0 and count[\"S\"] >= 1 or count[\"N\"] >= 1 and count[\"S\"] == 0:\n print(\"No\")\nelif count[\"E\"] == 0 and count[\"W\"] >= 1 or count[\"E\"] >= 1 and count[\"W\"] == 0:\n print(\"No\")\nelse:\n print(\... | S = input()
count = {s: 0 for s in "NWSE"}
for s in S:
count[s] += 1
if count["N"] == 0 and count["S"] >= 1 or count["N"] >= 1 and count["S"] == 0:
print("No")
elif count["E"] == 0 and count["W"] >= 1 or count["E"] >= 1 and count["W"] == 0:
print("No")
else:
print("Yes") |
[
7,
0,
13,
4,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
0,
13,
17,
4,
13,
13,
10,... | [
[
56,
2
],
[
65,
6
],
[
57,
12
],
[
57,
15
],
[
68,
17
],
[
57,
23
],
[
57,
26
],
[
71,
28
],
[
57,
34
],
[
57,
37
],
[
59,
39
],
[
57,
45
],
[
57,
48
],
[
... | [
"s = input()\nanswer = \"Yes\"\nif \"N\" in s and \"S\" not in s:\n\tanswer = \"No\"\nelif \"S\" in s and \"N\" not in s:\n\tanswer = \"No\"\nelif \"W\" in s and \"E\" not in s:\n\tanswer = \"No\"\nelif \"E\" in s and \"W\" not in s:\n\tanswer = \"No\"\nprint(answer)",
"s = input()",
"s",
"input()",
"input"... | s = input()
answer = "Yes"
if "N" in s and "S" not in s:
answer = "No"
elif "S" in s and "N" not in s:
answer = "No"
elif "W" in s and "E" not in s:
answer = "No"
elif "E" in s and "W" not in s:
answer = "No"
print(answer)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
0,
18,
13,
18,
13,
13,
17,
14,
2,
2,
2,
2,
2,
18,
13,
17,
17,
40,
18,
13,
17,
17,
2,
40,
18,
13,
17,
17,
... | [
[
93,
2
],
[
90,
6
],
[
11,
10
],
[
14,
13
],
[
17,
16
],
[
20,
19
],
[
23,
22
],
[
94,
27
],
[
34,
29
],
[
91,
30
],
[
94,
32
],
[
22,
33
],
[
91,
42
],
[
... | [
"# https://atcoder.jp/contests/agc003/tasks/agc003_a\n\ns = input()\nd = dict(N=0, W=0, S=0, E=0)\n\nfor i in range(len(s)):\n d[s[i]] += 1\n\nif (d['N'] == 0 and d['S'] != 0) or (d['N'] != 0 and d['S'] == 0) or (d['W'] == 0 and d['E'] != 0) or (d['E'] == 0 and d['W'] != 0):\n print('No')\nelse:\n print('Y... | # https://atcoder.jp/contests/agc003/tasks/agc003_a
s = input()
d = dict(N=0, W=0, S=0, E=0)
for i in range(len(s)):
d[s[i]] += 1
if (d['N'] == 0 and d['S'] != 0) or (d['N'] != 0 and d['S'] == 0) or (d['W'] == 0 and d['E'] != 0) or (d['E'] == 0 and d['W'] != 0):
print('No')
else:
print('Yes') |
[
7,
0,
13,
4,
13,
4,
13,
14,
2,
2,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
14,
2,
2,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,... | [
[
81,
2
],
[
82,
13
],
[
82,
20
],
[
82,
28
],
[
82,
35
],
[
82,
45
],
[
82,
52
],
[
82,
60
],
[
82,
67
],
[
81,
82
]
] | [
"S = str(input())\n\nif (S.count(\"N\") !=0 and S.count(\"S\") !=0) or (S.count(\"N\") ==0 and S.count(\"S\") ==0):\n if (S.count(\"W\") !=0 and S.count(\"E\") !=0) or (S.count(\"W\") ==0 and S.count(\"E\") ==0):\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")",
"S = str(inp... | 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") |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
28,
13,
13,
4,
18,
13,
13,
13,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
2,
17,
13,
2,
17,
13,
4,
13,
17,
14,
2,
2,
2,
40,
2,
17,
13,
40,
2,
17,
13,
2,
17,
13,
2,
17,
13,
4,... | [
[
84,
2
],
[
87,
8
],
[
13,
12
],
[
85,
12
],
[
88,
16
],
[
12,
18
],
[
88,
25
],
[
88,
28
],
[
88,
31
],
[
88,
34
],
[
88,
45
],
[
88,
49
],
[
88,
52
],
[
... | [
"S = list(input())\ndir_set = set()\nfor s in S:\n dir_set.add(s)\n\nif 'N' in dir_set and 'S' in dir_set and 'W' in dir_set and 'E' in dir_set:\n ### \"NSFW\" 全部ある場合 \n print(\"Yes\")\nelif not 'N' in dir_set and not 'S' in dir_set and 'W' in dir_set and 'E' in dir_set:\n ### \"NS\" はなく \"EW\" が両方ある... | S = list(input())
dir_set = set()
for s in S:
dir_set.add(s)
if 'N' in dir_set and 'S' in dir_set and 'W' in dir_set and 'E' in dir_set:
### "NSFW" 全部ある場合
print("Yes")
elif not 'N' in dir_set and not 'S' in dir_set and 'W' in dir_set and 'E' in dir_set:
### "NS" はなく "EW" が両方ある場合
print("Yes")
el... |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
4,
13,
17,
4,
13,
4,
13,
17,
10,
4,
13
] | [
[
46,
2
],
[
47,
10
],
[
47,
13
],
[
47,
17
],
[
47,
20
],
[
47,
26
],
[
47,
29
],
[
47,
33
],
[
47,
36
],
[
46,
47
]
] | [
"s = input()\n\nif ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s):\n if ('W' in s and 'E' in s) or ('W' not in s and 'E' not in s):\n print('Yes')\n exit()\n\nprint('No')",
"s = input()",
"s",
"input()",
"input",
"if ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s):\... | s = input()
if ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s):
if ('W' in s and 'E' in s) or ('W' not in s and 'E' not in s):
print('Yes')
exit()
print('No')
|
[
7,
0,
13,
4,
13,
0,
13,
39,
39,
17,
17,
17,
17,
39,
17,
17,
17,
17,
39,
17,
17,
17,
17,
0,
13,
2,
39,
17,
17,
28,
13,
13,
14,
2,
13,
17,
0,
18,
13,
17,
17,
14,
2,
13,
17,
0,
18,
13,
17,
17,
14,
2,
13,
17,
0,
... | [
[
75,
2
],
[
78,
6
],
[
81,
24
],
[
31,
30
],
[
76,
30
],
[
30,
34
],
[
40,
37
],
[
82,
38
],
[
30,
43
],
[
49,
46
],
[
82,
47
],
[
30,
52
],
[
58,
55
],
[
... | [
"s = input()\nli = [[1, 1, 0, 0], [0, 0, 1, 1], [1, 1, 1, 1]]\n\ndirection = [0] * 4\n\nfor i in s:\n if i == 'N':\n direction[0] = 1\n elif i == 'S':\n direction[1] = 1\n elif i == 'W':\n direction[2] = 1\n else:\n direction[3] = 1\n\nif direction in li:\n print('Yes')\ne... | s = input()
li = [[1, 1, 0, 0], [0, 0, 1, 1], [1, 1, 1, 1]]
direction = [0] * 4
for i in s:
if i == 'N':
direction[0] = 1
elif i == 'S':
direction[1] = 1
elif i == 'W':
direction[2] = 1
else:
direction[3] = 1
if direction in li:
print('Yes')
else:
print('No') |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
28,
2
],
[
29,
10
],
[
29,
13
],
[
29,
17
],
[
29,
20
],
[
28,
29
]
] | [
"s = input()\nif ('N' in s) ^ ('S'in s) or ('W' in s) ^ ('E' in s):\n print('No')\nelse:\n print('Yes')",
"s = input()",
"s",
"input()",
"input",
"if ('N' in s) ^ ('S'in s) or ('W' in s) ^ ('E' in s):\n print('No')\nelse:\n print('Yes')",
"('N' in s) ^ ('S'in s) or ('W' in s) ^ ('E' in s)",
... | s = input()
if ('N' in s) ^ ('S'in s) or ('W' in s) ^ ('E' in s):
print('No')
else:
print('Yes') |
[
7,
0,
13,
4,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
13,
... | [
[
63,
2
],
[
66,
6
],
[
64,
11
],
[
64,
15
],
[
69,
17
],
[
64,
22
],
[
64,
26
],
[
72,
28
],
[
64,
33
],
[
64,
37
],
[
75,
39
],
[
64,
44
],
[
64,
48
],
[
... | [
"S = input()\ncount =0\nif 'S' in S:\n if 'N' not in S:\n count = 1\nif 'N' in S:\n if 'S' not in S:\n count = 1\nif 'W' in S:\n if 'E' not in S:\n count = 1\nif 'E' in S:\n if 'W' not in S:\n count = 1\nif count ==1:\n print('No')\nelse:\n print('Yes')",
"S = input()",
"S",
"input()",
"in... | S = input()
count =0
if 'S' in S:
if 'N' not in S:
count = 1
if 'N' in S:
if 'S' not in S:
count = 1
if 'W' in S:
if 'E' not in S:
count = 1
if 'E' in S:
if 'W' not in S:
count = 1
if count ==1:
print('No')
else:
print('Yes') |
[
7,
0,
13,
4,
13,
0,
13,
39,
2,
2,
17,
13,
40,
17,
13,
2,
40,
17,
13,
2,
17,
13,
2,
2,
17,
13,
40,
17,
13,
2,
40,
17,
13,
2,
17,
13,
4,
13,
8,
4,
13,
13,
17,
17,
10,
4,
13,
10,
39,
13
] | [
[
45,
2
],
[
48,
6
],
[
46,
11
],
[
46,
14
],
[
46,
18
],
[
46,
21
],
[
46,
25
],
[
46,
28
],
[
46,
32
],
[
46,
35
],
[
49,
41
],
[
45,
46
],
[
48,
49
]
] | [
"S = input()\ncannot = [\n \"N\" in S and \"S\" not in S,\n \"N\" not in S and \"S\" in S,\n \"W\" in S and \"E\" not in S,\n \"W\" not in S and \"E\" in S,\n]\nprint(\"No\" if any(cannot) else \"Yes\")",
"S = input()",
"S",
"input()",
"input",
"cannot = [\n \"N\" in S and \"S\" not in S,\n... | S = input()
cannot = [
"N" in S and "S" not in S,
"N" not in S and "S" in S,
"W" in S and "E" not in S,
"W" not in S and "E" in S,
]
print("No" if any(cannot) else "Yes") |
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
22,
17,
17,
28,
13,
13,
0,
18,
13,
13,
17,
12,
13,
14,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
14,
2,
2,
18,
13,
17,
18,
13,
17,
17,... | [
[
93,
2
],
[
96,
9
],
[
25,
24
],
[
94,
24
],
[
30,
27
],
[
97,
28
],
[
24,
29
],
[
97,
37
],
[
97,
42
],
[
97,
49
],
[
97,
52
],
[
97,
61
],
[
97,
66
],
[
... | [
"s = input().strip()\n\ncounts = {\n 'N': 0, 'W': 0, 'S': 0, 'E': 0\n}\n\nfor c in s:\n counts[c] += 1\n\n\ndef judge():\n if counts['N'] > 0 or counts['S'] > 0:\n if counts['N'] * counts['S'] == 0:\n return False\n\n if counts['W'] > 0 or counts['E'] > 0:\n if counts['W'] * cou... | s = input().strip()
counts = {
'N': 0, 'W': 0, 'S': 0, 'E': 0
}
for c in s:
counts[c] += 1
def judge():
if counts['N'] > 0 or counts['S'] > 0:
if counts['N'] * counts['S'] == 0:
return False
if counts['W'] > 0 or counts['E'] > 0:
if counts['W'] * counts['E'] == 0:
... |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
0,
13,
17,
14,
... | [
[
63,
2
],
[
66,
8
],
[
64,
13
],
[
64,
17
],
[
78,
19
],
[
64,
24
],
[
64,
28
],
[
72,
30
],
[
64,
35
],
[
64,
39
],
[
69,
41
],
[
64,
46
],
[
64,
50
],
[
... | [
"S = list(input())\nflag = True\nif \"N\" in S:\n if \"S\" not in S:\n flag = False\nif \"S\" in S:\n if \"N\" not in S:\n flag = False\nif \"E\" in S:\n if \"W\" not in S:\n flag = False\nif \"W\" in S:\n if \"E\" not in S:\n flag = False\nif flag:\n print(\"Yes\")\nelse:\n print(\"No\")",
"S =... | S = list(input())
flag = True
if "N" in S:
if "S" not in S:
flag = False
if "S" in S:
if "N" not in S:
flag = False
if "E" in S:
if "W" not in S:
flag = False
if "W" in S:
if "E" not in S:
flag = False
if flag:
print("Yes")
else:
print("No") |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
2,
2,
4,
... | [
[
73,
2
],
[
74,
13
],
[
74,
20
],
[
74,
28
],
[
74,
35
],
[
74,
43
],
[
74,
50
],
[
74,
58
],
[
74,
65
],
[
73,
74
]
] | [
"S = input()\n\nif (S.count(\"W\")>0 and S.count(\"E\")==0) or (S.count(\"E\")>0 and S.count(\"W\")==0) or (S.count(\"N\")>0 and S.count(\"S\")==0) or (S.count(\"S\")>0 and S.count(\"N\")==0): print(\"No\")\nelse:\n print(\"Yes\")",
"S = input()",
"S",
"input()",
"input",
"if (S.count(\"W\")>0 and S.cou... | S = input()
if (S.count("W")>0 and S.count("E")==0) or (S.count("E")>0 and S.count("W")==0) or (S.count("N")>0 and S.count("S")==0) or (S.count("S")>0 and S.count("N")==0): print("No")
else:
print("Yes") |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
28,
13,
4,
13,
13,
0,
13,
18,
13,
13,
0,
18,
13,
13,
13,
14,
2,
17,
13,
14,
2,
17,
13,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
2,
17,
13,
4,
13,
17,
4,
13,
14,
... | [
[
85,
2
],
[
94,
6
],
[
86,
9
],
[
88,
11
],
[
16,
15
],
[
95,
18
],
[
91,
20
],
[
86,
22
],
[
15,
23
],
[
28,
25
],
[
89,
26
],
[
92,
27
],
[
92,
28
],
[
8... | [
"S=input()\nN=len(S)\nx=dict()\nfor i in range(N):\n s = S[i]\n x[s]=s\n\nif \"N\" in x:\n if \"S\" in x:\n pass\n else:\n print(\"No\")\n exit()\n\nif \"S\" in x:\n if \"N\" in x:\n pass\n else:\n print(\"No\")\n exit()\n\nif \"W\" in x:\n if \"E\" in ... | S=input()
N=len(S)
x=dict()
for i in range(N):
s = S[i]
x[s]=s
if "N" in x:
if "S" in x:
pass
else:
print("No")
exit()
if "S" in x:
if "N" in x:
pass
else:
print("No")
exit()
if "W" in x:
if "E" in x:
pass
else:
print("No... |
[
7,
15,
13,
13,
15,
15,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
29,
18,
4,
18,
18,
13,
13,
13,
39,
17,
12,
13,
29,
4,
13,
13,
4,
18,
4,
13,
13,
12,
13,
29,
4,
13,
4,
13,
12,
13,
41,
28,
13,
... | [
[
112,
14
],
[
119,
41
],
[
119,
49
],
[
55,
54
],
[
80,
57
],
[
116,
62
],
[
65,
64
],
[
69,
68
],
[
64,
72
],
[
68,
76
],
[
80,
80
],
[
121,
82
],
[
119,
86
],
... | [
"import sys, math\nfrom functools import lru_cache\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nMOD = 10**9+7\n\ndef input():\n return sys.stdin.readline()[:-1]\n\ndef mi():\n return map(int, input().split())\n\ndef ii():\n return int(input())\n\ndef i2(n):\n tmp = [list(mi()) for i in ... | import sys, math
from functools import lru_cache
from collections import deque
sys.setrecursionlimit(10**9)
MOD = 10**9+7
def input():
return sys.stdin.readline()[:-1]
def mi():
return map(int, input().split())
def ii():
return int(input())
def i2(n):
tmp = [list(mi()) for i in range(n)]
return ... |
[
7,
0,
13,
4,
13,
14,
2,
17,
13,
14,
2,
2,
17,
13,
17,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
2,
2,
17,
13,
17,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
2,
2,
17,
13,
17,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
2,
... | [
[
69,
2
],
[
70,
8
],
[
70,
13
],
[
70,
23
],
[
70,
28
],
[
70,
38
],
[
70,
43
],
[
70,
53
],
[
70,
58
],
[
69,
70
]
] | [
"st = input()\nif \"N\" in st:\n if (\"S\" in st) is False:\n print(\"No\")\n exit()\nif \"W\" in st:\n if (\"E\" in st) is False:\n print(\"No\")\n exit()\nif \"S\" in st:\n if (\"N\" in st) is False:\n print(\"No\")\n exit()\nif \"E\" in st:\n if (\"W\" in st)... | 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()
if "S" in st:
if ("N" in st) is False:
print("No")
exit()
if "E" in st:
if ("W" in st) is False:
print("No")
ex... |
[
7,
0,
13,
4,
13,
41,
28,
13,
13,
4,
13,
0,
13,
14,
2,
2,
2,
4,
13,
13,
17,
2,
13,
17,
2,
13,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
13
] | [
[
34,
2
],
[
8,
7
],
[
35,
7
],
[
7,
10
],
[
37,
19
],
[
35,
19
],
[
37,
22
],
[
35,
22
],
[
37,
25
],
[
35,
25
],
[
34,
35
]
] | [
"#!/usr/bin/env python3\ns = input()\ns = {i for i in s}\nif len(s) == 4 or s == {\"N\", \"S\"} or s == {\"W\", \"E\"}:\n print(\"Yes\")\nelse:\n print(\"No\")",
"s = input()",
"s",
"input()",
"input",
"i for i in s",
"for i in s",
"i",
"s",
"for i in s",
"i",
"s = {i for i in s}",
"s"... | #!/usr/bin/env python3
s = input()
s = {i for i in s}
if len(s) == 4 or s == {"N", "S"} or s == {"W", "E"}:
print("Yes")
else:
print("No")
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13,
10,
4,
13
] | [
[
29,
2
],
[
32,
6
],
[
30,
9
],
[
33,
14
],
[
30,
14
],
[
33,
17
],
[
30,
17
],
[
33,
20
],
[
30,
20
],
[
29,
30
],
[
32,
33
]
] | [
"s=input()\ns=set(s)\nif s=={\"N\",\"E\",\"S\",\"W\"} or s=={\"N\",\"S\"} or s=={\"E\",\"W\"}:\n print('Yes')\nelse:\n print('No')",
"s=input()",
"s",
"input()",
"input",
"s=set(s)",
"s",
"set(s)",
"set",
"s",
"if s=={\"N\",\"E\",\"S\",\"W\"} or s=={\"N\",\"S\"} or s=={\"E\",\"W\"}:\n p... | s=input()
s=set(s)
if s=={"N","E","S","W"} or s=={"N","S"} or s=={"E","W"}:
print('Yes')
else:
print('No')
|
[
7,
0,
13,
4,
13,
0,
13,
39,
39,
17,
17,
39,
17,
17,
28,
13,
13,
14,
2,
18,
13,
17,
13,
14,
40,
18,
13,
17,
13,
4,
13,
17,
4,
13,
17,
14,
2,
18,
13,
17,
13,
14,
40,
18,
13,
17,
13,
4,
13,
17,
4,
13,
17,
4,
13,... | [
[
60,
2
],
[
57,
6
],
[
16,
15
],
[
58,
15
],
[
15,
20
],
[
61,
22
],
[
15,
26
],
[
61,
28
],
[
15,
38
],
[
61,
40
],
[
15,
44
],
[
61,
46
],
[
57,
58
],
[
... | [
"s = input()\n\nL = [['W', 'E'], ['S', 'N']]\n\nfor l in L:\n if l[0] in s:\n if l[1] not in s:\n print(\"No\")\n exit(0)\n if l[1] in s:\n if l[0] not in s:\n print(\"No\")\n exit(0)\n\nprint(\"Yes\")",
"s = input()",
"s",
"input()",
"input",
"L = [['W', 'E'], ['S', 'N']]",
... | s = input()
L = [['W', 'E'], ['S', 'N']]
for l in L:
if l[0] in s:
if l[1] not in s:
print("No")
exit(0)
if l[1] in s:
if l[0] not in s:
print("No")
exit(0)
print("Yes") |
[
7,
0,
13,
4,
13,
15,
0,
13,
4,
13,
13,
14,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
4,
13,
17,
4,
13,
14,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
4,
13,
17,
4,
13,
14,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
... | [
[
83,
2
],
[
86,
7
],
[
84,
10
],
[
87,
15
],
[
87,
20
],
[
87,
32
],
[
87,
37
],
[
87,
49
],
[
87,
54
],
[
87,
66
],
[
87,
71
],
[
83,
84
],
[
86,
87
]
] | [
"s = input() #sys.stdin.readlineは最後が改行\n\nfrom collections import Counter\n\nc = Counter(s)\n\nif c['N'] >0 and c['S']==0:\n print('No')\n exit()\nif c['S'] >0 and c['N']==0:\n print('No')\n exit()\nif c['W'] >0 and c['E']==0:\n print('No')\n exit()\nif c['E'] >0 and c['W']==0:\n print('No')\n ... | s = input() #sys.stdin.readlineは最後が改行
from collections import Counter
c = Counter(s)
if c['N'] >0 and c['S']==0:
print('No')
exit()
if c['S'] >0 and c['N']==0:
print('No')
exit()
if c['W'] >0 and c['E']==0:
print('No')
exit()
if c['E'] >0 and c['W']==0:
print('No')
exit()
print('Yes'... |
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
0,
13,
2,
13,
2,
18,
13,
13,
17,
0,
13,
2,
13,
2,
18,
13,
13,
17,
0,
13,
2,
13,
2,
18,
13,
13,
17,
0,
13,
2,
13,
2,
1... | [
[
94,
2
],
[
109,
6
],
[
97,
9
],
[
103,
12
],
[
100,
15
],
[
19,
18
],
[
95,
23
],
[
121,
25
],
[
110,
27
],
[
122,
27
],
[
95,
30
],
[
18,
31
],
[
124,
34
],
... | [
"t = input()\n\nn = False\ns = False\ne = False\nw = False\n\nfor i in range(len(t)):\n n = n or t[i] == 'N'\n s = s or t[i] == 'S'\n e = e or t[i] == 'E'\n w = w or t[i] == 'W'\n\nok = True\nok = (n and s) or (not n and not s)\nok = ok and ((e and w) or (not e and not w))\nprint('Yes' if ok else 'No')"... | t = input()
n = False
s = False
e = False
w = False
for i in range(len(t)):
n = n or t[i] == 'N'
s = s or t[i] == 'S'
e = e or t[i] == 'E'
w = w or t[i] == 'W'
ok = True
ok = (n and s) or (not n and not s)
ok = ok and ((e and w) or (not e and not w))
print('Yes' if ok else 'No')
|
[
7,
0,
13,
4,
13,
4,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
30,
2
],
[
31,
12
],
[
31,
15
],
[
31,
19
],
[
31,
22
],
[
30,
31
]
] | [
"s = list(input())\nif ('N' in s) == ('S' in s) and ('E' in s) == ('W' in s):\n print('Yes')\nelse:\n print('No')",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"if ('N' in s) == ('S' in s) and ('E' in s) == ('W' in s):\n print('Yes')\nelse:\n print('No')",
"('N' in s) ... | s = list(input())
if ('N' in s) == ('S' in s) and ('E' in s) == ('W' in s):
print('Yes')
else:
print('No') |
[
7,
15,
0,
13,
4,
13,
4,
13,
12,
13,
14,
2,
2,
2,
13,
17,
40,
13,
17,
2,
40,
13,
17,
2,
13,
17,
29,
17,
29,
17,
23,
13,
23,
13,
0,
13,
4,
13,
13,
14,
2,
4,
13,
18,
13,
17,
18,
13,
17,
4,
13,
18,
13,
17,
18,
... | [
[
70,
3
],
[
31,
14
],
[
33,
17
],
[
31,
21
],
[
33,
24
],
[
31,
31
],
[
33,
33
],
[
67,
35
],
[
71,
38
],
[
65,
42
],
[
68,
44
],
[
68,
47
],
[
65,
50
],
[
... | [
"from collections import Counter\nS = list(input())\ndef zeroandnot0(a, b):\n if (a == 0 and b != 0) or (a != 0 and b == 0):\n return True\n else:\n return False\nc = Counter(S)\nif zeroandnot0(c['E'], c['W']) or zeroandnot0(c['N'], c['S']):\n print('No')\nelse:\n print('Yes')",
"from co... | from collections import Counter
S = list(input())
def zeroandnot0(a, b):
if (a == 0 and b != 0) or (a != 0 and b == 0):
return True
else:
return False
c = Counter(S)
if zeroandnot0(c['E'], c['W']) or zeroandnot0(c['N'], c['S']):
print('No')
else:
print('Yes')
|
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
14,
2,
2,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
0,
13,
17,
14,
2,
4,
13,
13,
17,
0,
... | [
[
5,
4
],
[
13,
12
],
[
4,
18
],
[
22,
21
],
[
4,
28
],
[
4,
32
],
[
4,
35
],
[
4,
39
],
[
4,
43
],
[
4,
46
],
[
49,
48
],
[
4,
54
],
[
58,
57
],
[
57,
... | [
"def main():\n S=set(list(input()))\n flag=0\n if len(S)%2:\n flag=1\n if ('N' in S and ('W' in S or 'E' in S)) or ('S' in S and ('W' in S or 'E' in S)):\n flag=1\n if len(S)==4:\n flag=0\n print('No' if flag else 'Yes')\n\nmain()",
"def main():\n S=set(list(input()))\n ... | def main():
S=set(list(input()))
flag=0
if len(S)%2:
flag=1
if ('N' in S and ('W' in S or 'E' in S)) or ('S' in S and ('W' in S or 'E' in S)):
flag=1
if len(S)==4:
flag=0
print('No' if flag else 'Yes')
main() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
2,
2,
40,
13,
17,
40,
13,
17,
2,
13,
17,
2,
13,
17,
4,
13,
17,
14,
2,
... | [
[
99,
2
],
[
96,
8
],
[
100,
11
],
[
102,
15
],
[
100,
18
],
[
108,
22
],
[
100,
25
],
[
105,
29
],
[
100,
32
],
[
97,
40
],
[
103,
43
],
[
109,
46
],
[
106,
49
]... | [
"S = list(input())\n\nn = S.count(\"N\")\ns = S.count(\"S\")\ne = S.count(\"E\")\nw = S.count(\"W\")\n\nif n!=0 and s!=0 and e==0 and w==0:\n print(\"Yes\")\nelif n==0 and s==0 and e!=0 and w!=0:\n print(\"Yes\")\nelif n!=0 and s!=0 and e!=0 and w!=0:\n print(\"Yes\")\nelse:\n print(\"No\")",
"S = lis... | S = list(input())
n = S.count("N")
s = S.count("S")
e = S.count("E")
w = S.count("W")
if n!=0 and s!=0 and e==0 and w==0:
print("Yes")
elif n==0 and s==0 and e!=0 and w!=0:
print("Yes")
elif n!=0 and s!=0 and e!=0 and w!=0:
print("Yes")
else:
print("No") |
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13... | [
[
133,
2
],
[
121,
6
],
[
124,
9
],
[
115,
12
],
[
136,
15
],
[
19,
18
],
[
134,
23
],
[
134,
27
],
[
18,
28
],
[
127,
31
],
[
134,
36
],
[
18,
37
],
[
130,
40
],... | [
"S=input()\nn=0\ns=0\nw=0\ne=0\nfor i in range(len(S)):\n if S[i]==\"N\":\n n+=1\n if S[i]==\"S\":\n s+=1\n if S[i]==\"W\":\n w+=1\n if S[i]==\"E\":\n e+=1\n\nif n!=0 and s!=0 and w!=0 and e!=0 or n==0 and s==0 and w!=0 and e!=0 or n!=0 and s!=0 and w==0 and e==0:\n print(... | S=input()
n=0
s=0
w=0
e=0
for i in range(len(S)):
if S[i]=="N":
n+=1
if S[i]=="S":
s+=1
if S[i]=="W":
w+=1
if S[i]=="E":
e+=1
if n!=0 and s!=0 and w!=0 and e!=0 or n==0 and s==0 and w!=0 and e!=0 or n!=0 and s!=0 and w==0 and e==0:
print("Yes")
else:
print("No")... |
[
7,
0,
13,
4,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
14,
2,
2,
17,
13,
40,
2,
17,
13,
0,
13,
17,
... | [
[
75,
2
],
[
63,
6
],
[
76,
12
],
[
76,
16
],
[
69,
18
],
[
76,
24
],
[
76,
28
],
[
72,
30
],
[
76,
36
],
[
76,
40
],
[
60,
42
],
[
76,
48
],
[
76,
52
],
[
... | [
"S=input()\nans=\"Yes\"\nif \"N\" in S and not \"S\" in S:\n ans=\"No\"\nif \"S\" in S and not \"N\" in S:\n ans=\"No\"\nif \"E\" in S and not \"W\" in S:\n ans=\"No\"\nif \"W\" in S and not \"E\" in S:\n ans=\"No\"\nprint(ans)",
"S=input()",
"S",
"input()",
"input",
"ans=\"Yes\"",
"ans",
"\"Yes\"... | S=input()
ans="Yes"
if "N" in S and not "S" in S:
ans="No"
if "S" in S and not "N" in S:
ans="No"
if "E" in S and not "W" in S:
ans="No"
if "W" in S and not "E" in S:
ans="No"
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
2,
17,
13,
13,
2,
17,
13,
13,
2,
17,
13,
13,
2,
17,
13,
0,
13,
40,
2,
13,
13,
0,
13,
40,
2,
13,
13,
0,
13,
8,
2,
13,
13,
17,
17,
4,
13,
13,
10,
8,
13,
10,
2,
13,
10,
2,
13,
10,
40,
... | [
[
67,
2
],
[
52,
6
],
[
68,
9
],
[
49,
10
],
[
68,
13
],
[
61,
14
],
[
68,
17
],
[
58,
18
],
[
68,
21
],
[
55,
23
],
[
53,
26
],
[
62,
27
],
[
64,
29
],
[
5... | [
"S=input()\n\nn,w,s,e='N' in S,'W' in S,'S' in S,'E' in S\n\ncand1=not n^s\ncand2=not w^e\n\nans=\"Yes\" if cand1 and cand2 else \"No\"\nprint(ans)",
"S=input()",
"S",
"input()",
"input",
"n,w,s,e='N' in S,'W' in S,'S' in S,'E' in S",
"n",
"'N' in S",
"'N'",
"S",
"w",
"'W' in S",
"'W'",
"S... | S=input()
n,w,s,e='N' in S,'W' in S,'S' in S,'E' in S
cand1=not n^s
cand2=not w^e
ans="Yes" if cand1 and cand2 else "No"
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
17,
14,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
0,
13,
17,
14,
... | [
[
118,
2
],
[
121,
6
],
[
119,
9
],
[
127,
13
],
[
119,
16
],
[
112,
20
],
[
119,
23
],
[
109,
27
],
[
119,
30
],
[
103,
34
],
[
122,
41
],
[
128,
44
],
[
113,
47
... | [
"s = input()\nN = s.count('N')\nW = s.count('W')\nS = s.count('S')\nE = s.count('E')\nans = ''\nif N > 0 and W > 0 and S > 0 and E > 0:\n ans = 'Yes'\nelif N == 0 and W > 0 and S == 0 and E > 0:\n ans = 'Yes'\nelif N > 0 and W == 0 and S > 0 and E == 0:\n ans = 'Yes'\nelse:\n ans = 'No'\nprint(ans)",
"s = inp... | s = input()
N = s.count('N')
W = s.count('W')
S = s.count('S')
E = s.count('E')
ans = ''
if N > 0 and W > 0 and S > 0 and E > 0:
ans = 'Yes'
elif N == 0 and W > 0 and S == 0 and E > 0:
ans = 'Yes'
elif N > 0 and W == 0 and S > 0 and E == 0:
ans = 'Yes'
else:
ans = 'No'
print(ans) |
[
7,
15,
13,
0,
13,
12,
4,
18,
4,
18,
18,
13,
13,
13,
13,
4,
18,
13,
13,
4,
13,
17,
2,
17,
17,
0,
13,
12,
4,
18,
18,
13,
13,
13,
2,
13,
17,
23,
0,
13,
4,
13,
0,
13,
2,
2,
17,
13,
2,
17,
13,
0,
13,
2,
2,
17,
... | [
[
93,
4
],
[
84,
26
],
[
90,
39
],
[
94,
41
],
[
87,
43
],
[
91,
47
],
[
91,
50
],
[
81,
52
],
[
91,
56
],
[
91,
59
],
[
88,
63
],
[
82,
66
],
[
96,
69
],
[
... | [
"import sys\ninput = lambda : sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x+\"\\n\")\n\n\ns = input()\nv1 = (\"N\" in s) + (\"S\" in s)\nv2 = (\"W\" in s) + (\"E\" in s)\nif v1==1 or v2==1:\n ans = \"No\"\nelse:\n ans = \"Yes\"\nprint(ans)",
"im... | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
s = input()
v1 = ("N" in s) + ("S" in s)
v2 = ("W" in s) + ("E" in s)
if v1==1 or v2==1:
ans = "No"
else:
ans = "Yes"
print(ans) |
[
7,
15,
0,
13,
4,
13,
0,
13,
4,
13,
13,
28,
13,
13,
0,
18,
13,
13,
17,
14,
2,
2,
18,
13,
17,
18,
13,
17,
2,
18,
13,
17,
18,
13,
17,
4,
13,
17,
14,
2,
2,
18,
13,
17,
18,
13,
17,
40,
2,
18,
13,
17,
18,
13,
17,
... | [
[
82,
3
],
[
85,
7
],
[
13,
12
],
[
83,
12
],
[
18,
15
],
[
86,
16
],
[
12,
17
],
[
86,
23
],
[
86,
26
],
[
86,
30
],
[
86,
33
],
[
86,
42
],
[
86,
45
],
[
... | [
"from collections import defaultdict\n\nS = input()\n\ncnt = defaultdict(bool)\nfor s in S:\n cnt[s] = True\n\nif (cnt[\"S\"] and cnt[\"N\"]) and (cnt[\"E\"] and cnt[\"W\"]):\n print(\"Yes\")\nelif (cnt[\"S\"] and cnt[\"N\"]) and not (cnt[\"E\"] or cnt[\"W\"]):\n print(\"Yes\")\nelif not (cnt[\"S\"] or cnt[\"N\"... | from collections import defaultdict
S = input()
cnt = defaultdict(bool)
for s in S:
cnt[s] = True
if (cnt["S"] and cnt["N"]) and (cnt["E"] and cnt["W"]):
print("Yes")
elif (cnt["S"] and cnt["N"]) and not (cnt["E"] or cnt["W"]):
print("Yes")
elif not (cnt["S"] or cnt["N"]) and (cnt["E"] and cnt["W"]):
print("... |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
17,
4,
18,
13,
13,
2,
17,
17,
12,
13,
0,
13,
4,
13,
0,
13,
39,
17,
17,
17,
14,
2,
4,
13,
13,
13,
4,
13,
17,
4,
13,
17,
14,
2,
13,... | [
[
63,
4
],
[
60,
11
],
[
66,
18
],
[
33,
32
],
[
37,
36
],
[
32,
45
],
[
36,
46
],
[
70,
58
],
[
60,
61
],
[
63,
64
],
[
66,
67
]
] | [
"import sys\n\nreadline = sys.stdin.readline\nMOD = 10 ** 9 + 7\nINF = float('INF')\nsys.setrecursionlimit(10 ** 5)\n\n\ndef main():\n s = input()\n ok = [{\"N\", \"S\"}, {\"E\", \"W\"}, {\"N\", \"S\", \"E\", \"W\"}]\n if set(s) in ok:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __nam... | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
s = input()
ok = [{"N", "S"}, {"E", "W"}, {"N", "S", "E", "W"}]
if set(s) in ok:
print("Yes")
else:
print("No")
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
4,
13,
8,
2,
2,
4,
13,
13,
17,
2,
2,
4,
13,
13,
17,
2,
4,
18,
13,
13,
17,
4,
18,
13,
13,
17,
17,
17,
10,
4,
13
] | [
[
38,
2
],
[
39,
16
],
[
39,
22
],
[
39,
27
],
[
39,
32
],
[
38,
39
]
] | [
"S=list(set(input()))\nprint(\"Yes\" if len(S)==4 or (len(S)==2 and S.count(\"N\")==S.count(\"S\")) else \"No\")",
"S=list(set(input()))",
"S",
"list(set(input()))",
"list",
"set(input())",
"set",
"input()",
"input",
"print(\"Yes\" if len(S)==4 or (len(S)==2 and S.count(\"N\")==S.count(\"S\")) els... | S=list(set(input()))
print("Yes" if len(S)==4 or (len(S)==2 and S.count("N")==S.count("S")) else "No") |
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
13,
0,
13,
17,
0,
13,
17,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
40,
2,
17,
13,
40,
2,
17,
13,
4,
13,
17,
4,
13,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
40,
2,
17,
13,
40,
2,
17,
13,... | [
[
128,
2
],
[
137,
11
],
[
131,
14
],
[
129,
22
],
[
129,
25
],
[
129,
29
],
[
129,
33
],
[
129,
45
],
[
129,
48
],
[
129,
52
],
[
129,
56
],
[
64,
63
],
[
129,
68
... | [
"li = list(map(str, input()))\nx=0\ny=0\n\nif 'N' in li and 'S' in li and not 'E' in li and not 'W' in li:\n print('Yes')\n exit()\n \nif 'E' in li and 'W' in li and not 'S' in li and not 'N' in li:\n print('Yes')\n exit()\n\nfor i in range(len(li)):\n if li[i]=='N':\n x=x+1\n elif li[i]=='S':\n x=x-1\... | li = list(map(str, input()))
x=0
y=0
if 'N' in li and 'S' in li and not 'E' in li and not 'W' in li:
print('Yes')
exit()
if 'E' in li and 'W' in li and not 'S' in li and not 'N' in li:
print('Yes')
exit()
for i in range(len(li)):
if li[i]=='N':
x=x+1
elif li[i]=='S':
x=x-1
elif li[i]=='E':
... |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
39,
0,
13,
39,
28,
13,
13,
14,
2,
2,
13,
17,
2,
13,
17,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
14,
2,
2,
4,
13,
4,
13,
13,
17,
2,
4,
13,
4,
13,
13,
17,
4,
13,
17,
4,
13,
17,
... | [
[
60,
2
],
[
63,
8
],
[
57,
11
],
[
15,
14
],
[
61,
14
],
[
14,
19
],
[
14,
22
],
[
64,
26
],
[
14,
28
],
[
58,
31
],
[
14,
33
],
[
64,
41
],
[
58,
48
],
[
... | [
"s = list(input())\new = []\nsn = []\nfor i in s:\n if i == \"E\" or i == \"W\":\n ew.append(i)\n else:\n sn.append(i)\nif len(set(ew)) == 1 or len(set(sn)) == 1:\n print(\"No\")\nelse:\n print(\"Yes\")",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
... | s = list(input())
ew = []
sn = []
for i in s:
if i == "E" or i == "W":
ew.append(i)
else:
sn.append(i)
if len(set(ew)) == 1 or len(set(sn)) == 1:
print("No")
else:
print("Yes") |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
2,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,
4,
13,
17,
14,
2,
2,
2,
40,
4,
18,
13,
13,
17,
17,... | [
[
122,
2
],
[
119,
6
],
[
123,
9
],
[
123,
17
],
[
123,
24
],
[
123,
31
],
[
123,
38
],
[
123,
52
],
[
123,
59
],
[
123,
66
],
[
123,
73
],
[
123,
87
],
[
123,
94
... | [
"s=input()\nn=len(s)\nif s.count('N')!=0 and s.count('S')!=0 and s.count('E')!=0 and s.count('W')!=0:\n print('Yes')\nelif s.count('N')!=0 and s.count('S')!=0 and s.count('E')==0 and s.count('W')==0:\n print('Yes')\nelif s.count('N')==0 and s.count('S')==0 and s.count('E')!=0 and s.count('W')!=0:\n print('Yes')\... | s=input()
n=len(s)
if s.count('N')!=0 and s.count('S')!=0 and s.count('E')!=0 and s.count('W')!=0:
print('Yes')
elif s.count('N')!=0 and s.count('S')!=0 and s.count('E')==0 and s.count('W')==0:
print('Yes')
elif s.count('N')==0 and s.count('S')==0 and s.count('E')!=0 and s.count('W')!=0:
print('Yes')
else:
prin... |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
4,
13,
13,
17,
17,
4,
13,
17,
14,
2,
4,
13,
13,
17,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
4,
13,
17,
4,
13,
17,
10,
4,
13,... | [
[
58,
2
],
[
55,
8
],
[
59,
11
],
[
56,
17
],
[
59,
17
],
[
56,
27
],
[
59,
27
],
[
56,
34
],
[
59,
34
],
[
56,
37
],
[
59,
37
],
[
56,
41
],
[
59,
41
],
[
... | [
"s= list(input())\ns=set(s)\nif len(s)%2==1:\n print('No')\nelse:\n if len(s) == 2:\n if \"W\" in s and \"E\" in s or \"S\" in s and \"N\" in s:\n print(\"Yes\")\n else:\n print('No')\n else:\n print('Yes')",
"s= list(input())",
"s",
"list(input())",
"list... | s= list(input())
s=set(s)
if len(s)%2==1:
print('No')
else:
if len(s) == 2:
if "W" in s and "E" in s or "S" in s and "N" in s:
print("Yes")
else:
print('No')
else:
print('Yes')
|
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
22,
17,
17,
28,
13,
4,
13,
4,
13,
13,
0,
18,
13,
18,
13,
13,
17,
14,
2,
2,
2,
2,
2,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
2,
18,... | [
[
143,
2
],
[
140,
9
],
[
25,
24
],
[
144,
29
],
[
36,
31
],
[
141,
32
],
[
144,
34
],
[
24,
35
],
[
141,
46
],
[
141,
51
],
[
141,
56
],
[
141,
61
],
[
141,
69
]... | [
"S = input().strip()\nC = {\"N\":0,\"S\":0,\"E\":0,\"W\":0}\nfor i in range(len(S)):\n C[S[i]] += 1\nif C[\"N\"]>0 and C[\"S\"]>0 and C[\"E\"]>0 and C[\"W\"]>0 or C[\"N\"]==0 and C[\"S\"]==0 and C[\"E\"]>0 and C[\"W\"]>0\\\nor C[\"N\"]>0 and C[\"S\"]>0 and C[\"E\"]==0 and C[\"W\"]==0 or C[\"N\"]==0 and C[\"S\"]=... | 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 and C["E"]>0 and C["W"]>0 or C["N"]==0 and C["S"]==0 and C["E"]>0 and C["W"]>0\
or C["N"]>0 and C["S"]>0 and C["E"]==0 and C["W"]==0 or C["N"]==0 and C["S"]==0 and C["E"]==0 and C["W"]==0:
print("Yes"... |
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
14,
2,
2,
2,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
2,
2,
18,
1... | [
[
76,
3
],
[
82,
9
],
[
77,
12
],
[
85,
14
],
[
83,
23
],
[
83,
28
],
[
83,
34
],
[
83,
39
],
[
83,
45
],
[
83,
50
],
[
83,
56
],
[
83,
61
],
[
79,
65
],
[
... | [
"from collections import Counter\n\nS = list(input())\nc = Counter(S)\n\nans = True\n\nif (c[\"N\"]> 0 and c[\"S\"] == 0) or (c[\"N\"]== 0 and c[\"S\"] > 0) or (c[\"W\"] > 0 and c[\"E\"] == 0) or (c[\"W\"] == 0 and c[\"E\"] > 0):\n ans = False\n\nif ans:\n print(\"Yes\")\nelse:\n print(\"No\")",
"from co... | from collections import Counter
S = list(input())
c = Counter(S)
ans = True
if (c["N"]> 0 and c["S"] == 0) or (c["N"]== 0 and c["S"] > 0) or (c["W"] > 0 and c["E"] == 0) or (c["W"] == 0 and c["E"] > 0):
ans = False
if ans:
print("Yes")
else:
print("No")
|
[
7,
15,
0,
13,
4,
13,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
4,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
4,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
4,
13,
17,
14,
2,
17,
13,
14,
40,
17,
13,
4,
13,
... | [
[
62,
3
],
[
63,
9
],
[
63,
13
],
[
63,
22
],
[
63,
26
],
[
63,
35
],
[
63,
39
],
[
63,
48
],
[
63,
52
],
[
62,
63
]
] | [
"from sys import exit\ns = input()\nif \"N\" in s:\n if \"S\" not in s:\n exit(print(\"No\"))\nif \"S\" in s:\n if \"N\" not in s:\n exit(print(\"No\"))\nif \"W\" in s:\n if \"E\" not in s:\n exit(print(\"No\"))\nif \"E\" in s:\n if \"W\" not in s:\n exit(print(\"No\"))\nprin... | from sys import exit
s = input()
if "N" in s:
if "S" not in s:
exit(print("No"))
if "S" in s:
if "N" not in s:
exit(print("No"))
if "W" in s:
if "E" not in s:
exit(print("No"))
if "E" in s:
if "W" not in s:
exit(print("No"))
print("Yes") |
[
7,
15,
13,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
14,
2,
4,
13,
13,
17,
14,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
14,
2,
2,
17,
13,
2,
17,
13,
4,
13,
... | [
[
64,
4
],
[
70,
8
],
[
65,
13
],
[
67,
15
],
[
71,
18
],
[
68,
24
],
[
68,
33
],
[
68,
39
],
[
68,
42
],
[
68,
50
],
[
68,
53
],
[
64,
65
],
[
67,
68
],
[
... | [
"import collections\n\nS = input()\n\nc = collections.Counter(S)\nK = c.keys()\n\nif len(K) == 4:\n print('Yes')\nelif len(K) == 2:\n if 'N' in K and 'S' in K:\n print('Yes')\n elif 'W' in K and 'E' in K:\n print('Yes')\n else:\n print('No')\nelse:\n print('No')",
"import colle... | import collections
S = input()
c = collections.Counter(S)
K = c.keys()
if len(K) == 4:
print('Yes')
elif len(K) == 2:
if 'N' in K and 'S' in K:
print('Yes')
elif 'W' in K and 'E' in K:
print('Yes')
else:
print('No')
else:
print('No') |
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
14,
2,
4,
13,
13,
17,
0,
13,
17,
14,
2,
2,
4,
13,
13,
17,
2,
4,
13,
13,
17,
0,
13,
17,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
0,
13,
17,
0,
13,
17,
4,
13,
... | [
[
62,
2
],
[
63,
13
],
[
71,
16
],
[
63,
23
],
[
63,
28
],
[
65,
31
],
[
63,
38
],
[
63,
41
],
[
63,
45
],
[
63,
48
],
[
68,
50
],
[
59,
53
],
[
60,
57
],
[
... | [
"S = set(list(input()))\n\nif len(S) == 4:\n ans = \"Yes\"\nelif len(S) == 3 or len(S) == 1:\n ans = \"No\"\nelse:\n # print(list(S))\n if (\"N\" in S and \"S\" in S) or (\"E\" in S and \"W\" in S):\n ans = \"Yes\"\n else:\n ans = \"No\"\n\nprint(ans)",
"S = set(list(input()))",
"S"... | S = set(list(input()))
if len(S) == 4:
ans = "Yes"
elif len(S) == 3 or len(S) == 1:
ans = "No"
else:
# print(list(S))
if ("N" in S and "S" in S) or ("E" in S and "W" in S):
ans = "Yes"
else:
ans = "No"
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,... | [
[
85,
2
],
[
109,
6
],
[
100,
9
],
[
106,
12
],
[
94,
15
],
[
19,
18
],
[
86,
25
],
[
86,
29
],
[
18,
30
],
[
88,
33
],
[
86,
38
],
[
18,
39
],
[
103,
42
],
[
... | [
"t=input()\nn=0\ns=0\nw=0\ne=0\nfor i in range(int(len(t))):\n if t[i] ==\"N\":\n n=1\n if t[i] ==\"S\":\n s=1\n if t[i] ==\"E\":\n e=1\n if t[i] ==\"W\":\n w=1\nif (w+e)%2==0 and (n+s)%2==0:\n print(\"Yes\")\nelse:\n print(\"No\") ",
"t=input()",
"t",
"input()",
... | t=input()
n=0
s=0
w=0
e=0
for i in range(int(len(t))):
if t[i] =="N":
n=1
if t[i] =="S":
s=1
if t[i] =="E":
e=1
if t[i] =="W":
w=1
if (w+e)%2==0 and (n+s)%2==0:
print("Yes")
else:
print("No") |
[
7,
0,
13,
4,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
10,
2,
13,
10,
2,
13,
10,
2,
13,
10,
4,
13,
10,
2,
13
] | [
[
49,
2
],
[
46,
6
],
[
50,
9
],
[
52,
11
],
[
50,
14
],
[
43,
16
],
[
50,
19
],
[
40,
21
],
[
50,
24
],
[
47,
28
],
[
44,
29
],
[
53,
31
],
[
41,
32
],
[
4... | [
"t=input()\nn='N' in t\nw='W' in t\ns='S' in t\ne='E' in t\n\nif n==s and w==e:\n print('Yes')\nelse:\n print('No')",
"t=input()",
"t",
"input()",
"input",
"n='N' in t",
"n",
"'N' in t",
"'N'",
"t",
"w='W' in t",
"w",
"'W' in t",
"'W'",
"t",
"s='S' in t",
"s",
"'S' in t",
"... | t=input()
n='N' in t
w='W' in t
s='S' in t
e='E' in t
if n==s and w==e:
print('Yes')
else:
print('No') |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
14,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
14,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
... | [
[
63,
2
],
[
60,
8
],
[
64,
11
],
[
61,
16
],
[
64,
16
],
[
61,
19
],
[
64,
19
],
[
61,
27
],
[
64,
27
],
[
61,
30
],
[
64,
30
],
[
61,
38
],
[
64,
38
],
[
... | [
"s=str(input())\ns=list(s)\nif \"W\" in s and \"E\" not in s:\n print(\"No\")\nelif \"E\" in s and \"W\" not in s:\n print(\"No\")\nelif \"N\" in s and \"S\" not in s:\n print(\"No\")\nelif \"S\" in s and \"N\" not in s:\n print(\"No\")\nelse:\n print(\"Yes\")",
"s=str(input())",
"s",
"str(input())",
"... | s=str(input())
s=list(s)
if "W" in s and "E" not in s:
print("No")
elif "E" in s and "W" not in s:
print("No")
elif "N" in s and "S" not in s:
print("No")
elif "S" in s and "N" not in s:
print("No")
else:
print("Yes") |
[
7,
0,
13,
4,
13,
14,
2,
2,
40,
17,
13,
2,
17,
13,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
14,
2,
2,
40,
17,
13,
2,
17,
13,
2,
2,
17,
13,
40,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
47,
2
],
[
48,
10
],
[
48,
13
],
[
48,
17
],
[
48,
20
],
[
48,
29
],
[
48,
32
],
[
48,
36
],
[
48,
39
],
[
47,
48
]
] | [
"S=input()\nif ((\"S\" not in S) and (\"N\" in S)) or ((\"S\" in S) and (\"N\" not in S)):\n print(\"No\")\nelif ((\"W\" not in S) and (\"E\" in S)) or ((\"W\" in S) and (\"E\" not in S)):\n print(\"No\")\nelse:\n print(\"Yes\")",
"S=input()",
"S",
"input()",
"input",
"if ((\"S\" not in S) and (\... | S=input()
if (("S" not in S) and ("N" in S)) or (("S" in S) and ("N" not in S)):
print("No")
elif (("W" not in S) and ("E" in S)) or (("W" in S) and ("E" not in S)):
print("No")
else:
print("Yes") |
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
14,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
4,
13,
17,
4,
13,
4,
13,
17,
10,
4,
13
] | [
[
46,
2
],
[
47,
10
],
[
47,
13
],
[
47,
17
],
[
47,
20
],
[
47,
26
],
[
47,
29
],
[
47,
33
],
[
47,
36
],
[
46,
47
]
] | [
"s = input()\nif (\"N\" in s and \"S\" in s) or (\"N\" not in s and \"S\" not in s):\n if (\"W\" in s and \"E\" in s) or (\"W\" not in s and \"E\" not in s):\n print(\"Yes\")\n exit()\nprint(\"No\")",
"s = input()",
"s",
"input()",
"input",
"if (\"N\" in s and \"S\" in s) or (\"N\" not in... | s = input()
if ("N" in s and "S" in s) or ("N" not in s and "S" not in s):
if ("W" in s and "E" in s) or ("W" not in s and "E" not in s):
print("Yes")
exit()
print("No")
|
[
7,
0,
13,
4,
13,
14,
2,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
2,
2,
2,
17,
13,
2,
17,
13,
2,
40,
17,
13,
40,
17,
13,
4,
13,
17,
4,
13,
17,
10,
4,
13
] | [
[
44,
2
],
[
45,
11
],
[
45,
14
],
[
45,
18
],
[
45,
21
],
[
45,
26
],
[
45,
29
],
[
45,
33
],
[
45,
36
],
[
44,
45
]
] | [
"S = input()\n\nif (((\"N\" in S and \"S\" in S) \nor(\"N\" not in S and \"S\" not in S))\nand((\"E\" in S and \"W\" in S)\nor (\"E\" not in S and \"W\" not in S))):\n print('Yes')\nelse:\n print('No')",
"S = input()",
"S",
"input()",
"input",
"if (((\"N\" in S and \"S\" in S) \nor(\"N\" not in S an... | S = input()
if ((("N" in S and "S" in S)
or("N" not in S and "S" not in S))
and(("E" in S and "W" in S)
or ("E" not in S and "W" not in S))):
print('Yes')
else:
print('No') |
[
7,
15,
13,
12,
13,
12,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
13,
12,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
12,
13,
15,
0,
13,
4,
13,
4,
13,
0,
13,
17,
14,
2,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17... | [
[
10,
9
],
[
114,
13
],
[
9,
16
],
[
22,
21
],
[
114,
25
],
[
21,
30
],
[
107,
35
],
[
114,
39
],
[
110,
41
],
[
108,
48
],
[
108,
53
],
[
108,
59
],
[
108,
64
],... | [
"import sys\ndef rs(): return sys.stdin.readline().rstrip()\ndef ri(): return int(rs())\ndef rs_(): return [_ for _ in rs().split()]\ndef ri_(): return [int(_) for _ in rs().split()]\n\nfrom collections import Counter\nc = Counter(rs())\nf = False\nif (c['N'] > 0 and c['S'] > 0) or (c['N'] == 0 and c['S'] == 0):\n ... | 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 and c['S'] > 0) or (c['N'] == 0 and c['S'] == 0):
if (c['W'] >... |
[
7,
15,
13,
15,
15,
12,
13,
41,
28,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
14,
2,
2,
13,
17,
2,
2,
13,
17,
2,
2,
2,
17,
13,
2,
17,
13,
2,
2,
17,
13,
2,
17,
13,
4,
13,
17,
4,
13,
17,
0,
13,
1... | [
[
10,
9
],
[
9,
13
],
[
16,
15
],
[
21,
20
],
[
15,
23
],
[
20,
27
],
[
20,
31
],
[
15,
37
],
[
15,
40
],
[
15,
44
],
[
15,
47
],
[
77,
55
],
[
59,
58
],
[
... | [
"# -*- coding: utf-8 -*-\nimport sys\nfrom collections import deque, defaultdict\nfrom math import sqrt, factorial\n# def input(): return sys.stdin.readline()[:-1] # warning not \\n\n# def input(): return sys.stdin.buffer.readline().strip() # warning bytes\n# def input(): return sys.stdin.buffer.readline().decode('... | # -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')
de... |
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
14,
2,
2,
4,
18,
13,
13,
17,
17,
40,
4,
18,
13,
13,
17,
17,
0,
13,
17,
14,
2,
40,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
0,
13,
17,
14,
2,
2,
4,
... | [
[
100,
2
],
[
109,
6
],
[
115,
9
],
[
106,
12
],
[
101,
19
],
[
101,
26
],
[
112,
31
],
[
101,
38
],
[
101,
45
],
[
97,
50
],
[
101,
57
],
[
101,
64
],
[
103,
69
... | [
"S = input()\n\nNS = 'NS'\nWE = 'WE'\nanswer = 'Yes'\n\nif S.count('N') == 0 and S.count('S') != 0:\n answer = 'No'\nelif S.count('N') != 0 and S.count('S') == 0:\n answer = 'No'\n\nif S.count('W') == 0 and S.count('E') != 0:\n answer = 'No'\nelif S.count('W') != 0 and S.count('E') == 0:\n answer = 'No'... | S = input()
NS = 'NS'
WE = 'WE'
answer = 'Yes'
if S.count('N') == 0 and S.count('S') != 0:
answer = 'No'
elif S.count('N') != 0 and S.count('S') == 0:
answer = 'No'
if S.count('W') == 0 and S.count('E') != 0:
answer = 'No'
elif S.count('W') != 0 and S.count('E') == 0:
answer = 'No'
print(ans... |
[
7,
0,
13,
4,
13,
0,
13,
2,
39,
17,
17,
0,
13,
17,
28,
13,
13,
0,
18,
13,
4,
18,
13,
13,
13,
17,
0,
13,
2,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
2,
2,
18,
13,
17,
17,
2,
18,
13,
17,
17,
0,
13,
2,
2,
2,
... | [
[
88,
2
],
[
97,
6
],
[
85,
12
],
[
16,
15
],
[
89,
15
],
[
25,
18
],
[
98,
19
],
[
86,
22
],
[
15,
24
],
[
94,
27
],
[
98,
32
],
[
98,
37
],
[
98,
43
],
[
... | [
"S = input()\ndir = [0]*4\nmove = \"NWSE\"\nfor i in S:\n dir[move.index(i)] += 1\np1 = (dir[0] > 0 and dir[2] > 0) or (dir[0] == 0 and dir[2] == 0)\np2 = (dir[1] > 0 and dir[3] > 0) or (dir[1] == 0 and dir[3] == 0)\nprint(\"Yes\" if p1 and p2 else \"No\")",
"S = input()",
"S",
"input()",
"input",
"dir... | S = input()
dir = [0]*4
move = "NWSE"
for i in S:
dir[move.index(i)] += 1
p1 = (dir[0] > 0 and dir[2] > 0) or (dir[0] == 0 and dir[2] == 0)
p2 = (dir[1] > 0 and dir[3] > 0) or (dir[1] == 0 and dir[3] == 0)
print("Yes" if p1 and p2 else "No") |
[
7,
0,
13,
4,
13,
0,
13,
17,
14,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
0,
13,
17,
14,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
0,
13,
17,
14,
13,
4,
13,
17,
4,
13,
17,
10,
4,
... | [
[
55,
2
],
[
61,
6
],
[
56,
13
],
[
56,
20
],
[
64,
25
],
[
56,
32
],
[
56,
39
],
[
58,
44
],
[
55,
56
],
[
58,
59
],
[
61,
62
],
[
64,
65
]
] | [
"s=input()\npr=True\nif (s.count(\"N\")==0)^(s.count(\"S\")==0):\n pr=False\nif (s.count(\"E\")==0)^(s.count(\"W\")==0):\n pr=False\n\nif pr:\n print(\"Yes\")\nelse:\n print(\"No\")",
"s=input()",
"s",
"input()",
"input",
"pr=True",
"pr",
"True",
"if (s.count(\"N\")==0)^(s.count(\"S\")==0):\n p... | s=input()
pr=True
if (s.count("N")==0)^(s.count("S")==0):
pr=False
if (s.count("E")==0)^(s.count("W")==0):
pr=False
if pr:
print("Yes")
else:
print("No") |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
2,
13,
13,
2,
40,
13,
17,
40,
13,
17,
14,
2,
2,
13,
13,
2,
40,
13,
17,
... | [
[
69,
2
],
[
78,
8
],
[
70,
11
],
[
81,
15
],
[
70,
18
],
[
72,
22
],
[
70,
25
],
[
75,
29
],
[
70,
32
],
[
79,
38
],
[
73,
39
],
[
79,
42
],
[
73,
45
],
[
... | [
"l = list(input())\nn = l.count('N')\nw = l.count('W')\ns = l.count('S')\ne = l.count('E')\nif n == s or (n != 0 and s != 0):\n if w == e or (w != 0 and e != 0):\n print('Yes')\n exit(0)\nprint('No')",
"l = list(input())",
"l",
"list(input())",
"list",
"input()",
"input",
"n = l.count... | 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') |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
28,
13,
13,
14,
2,
13,
39,
17,
17,
4,
18,
13,
13,
13,
14,
2,
13,
39,
17,
17,
4,
18,
13,
13,
13,
14,
2,
2,
4,
13,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
17,
... | [
[
57,
2
],
[
63,
6
],
[
60,
10
],
[
15,
14
],
[
58,
14
],
[
14,
18
],
[
64,
24
],
[
14,
26
],
[
14,
29
],
[
61,
35
],
[
14,
37
],
[
64,
43
],
[
61,
48
],
[
... | [
"S = input()\nNS = set()\nEW = set()\nfor s in S:\n if s in [\"N\", \"S\"]:\n NS.add(s)\n if s in [\"E\", \"W\"]:\n EW.add(s)\nif len(NS) == 1 or len(EW) == 1:\n print(\"No\")\nelse:\n print(\"Yes\")",
"S = input()",
"S",
"input()",
"input",
"NS = set()",
"NS",
"set()",
"set",
"EW = set(... | S = input()
NS = set()
EW = set()
for s in S:
if s in ["N", "S"]:
NS.add(s)
if s in ["E", "W"]:
EW.add(s)
if len(NS) == 1 or len(EW) == 1:
print("No")
else:
print("Yes") |
[
7,
15,
12,
13,
0,
13,
4,
13,
13,
14,
2,
4,
13,
13,
17,
29,
17,
14,
2,
2,
2,
2,
18,
13,
17,
18,
13,
17,
17,
2,
2,
18,
13,
17,
18,
13,
17,
17,
2,
2,
2,
18,
13,
17,
18,
13,
17,
17,
2,
2,
18,
13,
17,
18,
13,
17... | [
[
6,
5
],
[
62,
8
],
[
62,
13
],
[
5,
23
],
[
5,
26
],
[
5,
32
],
[
5,
35
],
[
5,
42
],
[
5,
45
],
[
5,
51
],
[
5,
54
],
[
62,
62
],
[
67,
66
],
[
82,
7... | [
"#!/usr/bin/env python3\nfrom collections import Counter\n\ndef solve(S):\n s = Counter(S)\n if len(S) == 1:\n return \"No\"\n elif (s[\"N\"]*s[\"S\"] == 0 and s[\"N\"]+s[\"S\"] > 0) or \\\n (s[\"E\"]*s[\"W\"] == 0 and s[\"E\"]+s[\"W\"] > 0):\n return \"No\"\n else:\n return... | #!/usr/bin/env python3
from collections import Counter
def solve(S):
s = Counter(S)
if len(S) == 1:
return "No"
elif (s["N"]*s["S"] == 0 and s["N"]+s["S"] > 0) or \
(s["E"]*s["W"] == 0 and s["E"]+s["W"] > 0):
return "No"
else:
return "Yes"
def main():
S = input()
... |
[
7,
0,
13,
4,
13,
0,
13,
2,
39,
17,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
17,
0,
18,
13,
17,
17,
14,
2,
18,
13,
13,
17,
0,
18,
13,
17,
17,
14,
2,
18,
13,
13,
17,
0,
18,
13,
17,
17,
0,
18,
13,
17,
... | [
[
80,
2
],
[
77,
6
],
[
13,
12
],
[
81,
17
],
[
81,
21
],
[
12,
22
],
[
28,
25
],
[
78,
26
],
[
81,
32
],
[
12,
33
],
[
39,
36
],
[
78,
37
],
[
81,
43
],
[
... | [
"s = input()\nflag = [0] * 4\nfor i in range(len(s)):\n if s[i] == \"N\":\n flag[0] = 1\n elif s[i] == \"W\":\n flag[1] = 1\n elif s[i] == \"S\":\n flag[2] = 1\n else:\n flag[3] = 1\n\nprint(\"Yes\" if flag[0] == flag[2] and flag[1] == flag[3] else \"No\")",
"s = input()",
... | s = input()
flag = [0] * 4
for i in range(len(s)):
if s[i] == "N":
flag[0] = 1
elif s[i] == "W":
flag[1] = 1
elif s[i] == "S":
flag[2] = 1
else:
flag[3] = 1
print("Yes" if flag[0] == flag[2] and flag[1] == flag[3] else "No") |
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
14,
2,
17,
13,
14,
40,
2,
17,
13,
4,
13,
17,
4,
13,
14,
2,
2,
4,
13,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
14,
2,
17,
13,
14,
40,
2,
17,
13,
4,
13,
17,
4,
13,
14,
2,
2... | [
[
137,
2
],
[
138,
12
],
[
138,
17
],
[
138,
28
],
[
138,
33
],
[
138,
43
],
[
138,
48
],
[
138,
59
],
[
138,
64
],
[
138,
74
],
[
138,
79
],
[
138,
90
],
[
138,
95... | [
"s = set(list(input()))\n\nif 'N' in s:\n if not 'S' in s:\n print(\"No\")\n exit()\n elif len(s) == 2 or len(s)==4:\n print(\"Yes\")\n exit()\n \nif 'S' in s:\n if not 'N' in s:\n print(\"No\")\n exit()\n elif len(s) == 2 or len(s)==4:\n print(\"Yes\")\n exit()\n\nif 'W' in s:\n if ... | s = set(list(input()))
if 'N' in s:
if not 'S' in s:
print("No")
exit()
elif len(s) == 2 or len(s)==4:
print("Yes")
exit()
if 'S' in s:
if not 'N' in s:
print("No")
exit()
elif len(s) == 2 or len(s)==4:
print("Yes")
exit()
if 'W' in s:
if not 'E' in s:
print("No")
... |
[
7,
12,
13,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
0,
13,
2,
17,
13,
14,
2,
2,
13,
13,
2,
13,
13,
4,
13,
17,
4,
13,
17,
14,
2,
13,
... | [
[
7,
6
],
[
14,
13
],
[
6,
17
],
[
21,
20
],
[
13,
23
],
[
26,
25
],
[
13,
28
],
[
31,
30
],
[
13,
33
],
[
36,
35
],
[
13,
38
],
[
20,
42
],
[
25,
43
],
[
3... | [
"# row = [int(x) for x in input().rstrip().split(\" \")]\n# n = int(input().rstrip())\n# s = input().rstrip()\n\ndef resolve():\n import sys\n input = sys.stdin.readline\n\n se = input().rstrip()\n\n S = \"S\" in se\n N = \"N\" in se\n E = \"E\" in se\n W = \"W\" in se\n\n if (S ^ N) or (E ^... | # row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()
def resolve():
import sys
input = sys.stdin.readline
se = input().rstrip()
S = "S" in se
N = "N" in se
E = "E" in se
W = "W" in se
if (S ^ N) or (E ^ W):
print("No")
e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.