Harryxun/stf_run huggingface dataset:
n = int(input())
mod = 10**9+7
 
dp = [[[[0]*4 for _ in range(4)] for _ in range(4)] for _ in range(n+1)]
#長さ0の文字列は1
#0,1,2(A,G,C)に関する制約しかないため
#Sは、TTTSと考えてもよい
dp[0][3][3][3] = 1
 
#swapしてAGCが発生しない文字列:=AGC,ACG,GAC,A?GC,AG?Cを含まない文字列
#A:=0,G:=1,C:=2,T:=3
 
#文字列の文字数
for i in range(n):
    #最後から1文字目
    for j in range(4):
        #最後から2文字目
        for k in range(4):
            #条件に当てはまるものがない場合
            if dp[i][j][k] == 0:
                continue
            #最後から3文字目
            for l in range(4):
                #新たに追加する文字
                for a in range(4):
                    #ダメな5条件をカット
 
                    #AGCの場合
                    if a == 2 and j == 1 and k == 0:continue
                    #GACの場合
                    if a == 2 and j == 0 and k == 1:continue
                    #ACGの場合
                    if a == 1 and j == 2 and k == 0:continue
                    #A?GCの場合
                    if a == 2 and j == 1 and l == 0:continue
                    #AG?Cの場合
                    if a == 2 and k == 1 and l == 0:continue
 
                    #ダメの条件を抜けると、aを足した文字列が作れる
                    dp[i+1][a][j][k] += dp[i][j][k][l]
                    dp[i+1][a][j][k] %= mod
 
ans = 0
for j in range(4):
    for k in range(4):
        for l in range(4):
            #長さnの全通り回収
            ans += dp[n][j][k][l]
            ans %= mod
print(ans)

### FIXED CODE ###

n=input()
if n=='A':
    print('T')
elif n=='G':
    print('C')
elif n=='T':
    print('A')
else:
    print('G')
n = int(input())
la = list(map(int, input().split())
d = {}
ret = 'NO'
for a in la:
    if a in d:
        ret = 'YSE'
        break
    d[a] = ''
print(ret)


### FIXED CODE ###

aaa = int(input())
la = list(map(int, input().split()))
d = {}
ret = 'YES'
for a in la:
    if a in d:
        ret = 'NO'
        break
    d[a] = ''
print(ret)
import math

N, M = map(int, input().split())

print(math.factrial(N)//2 + math.factrial(M)//2)

### FIXED CODE ###

N, M = map(int, input().split())
 
print(N*(N-1)//2+M*(M-1)//2)
n,m=map(int,input().split())
s=[0]*m
c=[0]*m
for i in range(m):
    s[i],c[i]=map(int, input().split())

for num in range(1000):
    if len(str(num))==n:
        #print(num)
        digit=[0,str(num)[0],str(num)[1],str(num)[2]]
        digit[1]=int(digit[1])
        digit[2]=int(digit[2])
        digit[3]=int(digit[3])
        flag=0
        #print(100*int(digit[1])+10*int(digit[2])+int(digit[3]))
        #print(digit)
        for i in range(m):
            if digit[s[i]]==c[i]:
                flag+=1
        if flag==m:
            print(100*digit[1]+10*digit[2]+digit[3])
            exit()
print("-1")


### FIXED CODE ###

#https://atcoder.jp/contests/abc157/tasks/abc157_c
n,m=map(int,input().split())
s=[0]*m
c=[0]*m
for i in range(m):
    s[i],c[i]=map(int, input().split())

for num in range(1000):
    if len(str(num))==n:
        digit=[0]*n
        l=n
        k=num
        while l>0:
            digit[l-1]=k%10
            k=k//10
            l-=1
        flag=0
        for j in range(m):
            if digit[s[j]-1]==c[j]:
                flag+=1
        if flag==m:
            print(num)
            exit()
print("-1")
def get_binaly_arr(num,digit):
    return list(bin(num)[2:].zfill(digit))

def get_droped_mat(mat,binaly_arr,direction):
    if direction == "H":# 行をdrop!
        return [mat[i] for i in range(len(mat)) if binaly_arr[i] != "0" ]
    elif direction == "W": # 列をdrop!
        return [[arr[i] for i in range(len(arr)) if binaly_arr[i] != "0" ] for arr in mat]
    else :
        print("INVALID DIRECTION!")

def count_black(mat):
    return sum([sum([1 for item in arr if item == "#"]) for arr in mat])

    
if __name__ == "__main__":
    H,W,K = list(map(int,input().split()))
    c = []
    for i in range(0,H):
        c.append(list(input()))
    H_pattern_num = 2 ** H
    W_pattern_num = 2 ** W
    count = 0
    ite_num = 0
    for i in range(0,H_pattern_num):
        for j in range(0,W_pattern_num):
            # バイナリ配列を生成
            H_binaly_arr = get_binaly_arr(i,H)
            W_binaly_arr = get_binaly_arr(j,W)
            mat_temp = c.copy()
            mat_temp = get_droped_mat(c,H_binaly_arr,direction="H")
            mat_temp = get_droped_mat(mat_temp,W_binaly_arr,direction="W")
            if K == count_black(mat_temp):
                count += 1
    print(count)

### FIXED CODE ###

N = int(input())
sub = (N%1000)
print(0 if sub == 0 else (1000-sub))
X,Y = input().spilit(' ')
if int(X,16) < int(Y,16):
    print("<")
elif int(X,16) > int(Y,16):
    print(">")
else:
    print("=")


### FIXED CODE ###

X,Y = input().split(' ')
if int(X,16) < int(Y,16):
    print("<")
elif int(X,16) > int(Y,16):
    print(">")
else:
    print("=")
def main():
    from functools import lru_cache

    inf = 2 * 10 ** 14 + 1

    N = int(input())
    *a, = map(int, input().split())

    @lru_cache(maxsize=None)
    def recursion(cur, need):
        """
        cur: pickableなindex
        """
        if cur >= N:
            if need == 0:
                return 0
            else:
                return -inf

        rest = N - cur
        if (rest + 1) // 2 < need:
            return -inf

        return max(
            a[cur] + recursion(cur + 2, need - 1),
            recursion(cur + 1, need)
        )

    ans = recursion(0, N // 2)

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from collections import defaultdict

    inf = 10 ** 15

    N = int(input())
    *a, = map(int, input().split())

    it = iter(a)

    dp = [defaultdict(lambda: -inf) for _ in range(N + 1)]
    dp[0][0] = 0
    dp[1][0] = 0
    dp[1][1] = next(it)
    for i, x in enumerate(it, 2):
        mi = (i - 1) // 2
        ma = (i + 1) // 2
        for taken_count in range(mi, ma + 1):
            dp[i][taken_count] = max(
                dp[i - 1][taken_count],
                dp[i - 2][taken_count - 1] + x
            )

    ans = dp[N][N // 2]

    print(ans)


if __name__ == '__main__':
    main()
from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = Counter(a)
for i in range(1, N+1)
	try:
    	print(fact_count[i])
	except:
    	print(0)

### FIXED CODE ###

from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = dict(Counter(a))
for i in range(1, N+1):
    try:
        print(fact_count[str(i)])
    except:
        print(0)
r = int(input())
a = r[0]
b = r[1]
c = r[2]
d = r[3]
if a+b+c+d ==7:
  print(a+"+"+b+"+"+c+"+"+d"=7")
elif a+b+c-d ==7:
  print(a+"+"+b+"+"+c+"-"+d"=7")
elif a+b-c+d ==7:
  print(a+"+"+b+"-"+c+"+"+d"=7")
elif a+b-c-d ==7:
  print(a+"+"+b+"-"+c+"-"+d"=7")
elif a-b+c+d ==7:
  print(a+"-"+b+"+"+c+"+"+d"=7")
elif a-b+c-d ==7:
  print(a+"-"+b+"+"+c+"-"+d"=7")
elif a-b-c+d ==7:
  print(a+"-"+b+"-"+c+"+"+d"=7")
else:
  print(a+"-"+b+"-"+c+"-"+d"=7")

### FIXED CODE ###

r = input()
a = int(r[0])
b = int(r[1])
c = int(r[2])
d = int(r[3])
import sys

if a+b+c+d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"+"+r[2]+"+"+r[3]+"=7")
elif a+b+c-d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"+"+r[2]+"-"+r[3]+"=7")
elif a+b-c+d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"-"+r[2]+"+"+r[3]+"=7")
elif a+b-c-d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"-"+r[2]+"-"+r[3]+"=7")
elif a-b+c+d ==7:
  sys.stdout.write(r[0]+"-"+r[1]+"+"+r[2]+"+"+r[3]+"=7")
elif a-b+c-d ==7:
  sys.stdout.write(r[0]+"-"+r[1]+"+"+r[2]+"-"+r[3]+"=7")
elif a-b-c+d ==7:
  sys.stdout.write(r[0]+"-"+r[1]+"-"+r[2]+"+"+r[3]+"=7")
else:
  sys.stdout.write(r[0]+"-"+r[1]+"-"+r[2]+"-"+r[3]+"=7")
w,h,x,y,r = map(int, input().split())

a = true

if x<r or w-r<x:
    a = false

if y<r or h-r<y:
    a = false


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



### FIXED CODE ###

w,h,x,y,r = map(int, input().split())

a = True

if x < r or w - r < x :
    a = False

if y < r or h - r < y :
    a = False


if a:
    print("Yes")
else:
    print("No")
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N = int(input())
e = dd(list)
for i in range(N - 1):
  u, v = map(int, input().split())
  e[u].append((v, i))
  e[v].append((u, i))
res = [0] * (N - 1)
def dfs(x):
  global res
  c = 1
  vis = set()
  for y, i in e[x]: vis.add(res[i])
  #print(x, vis)
  for y, i in e[x]:
    if res[i] > 0: continue
    while c in vis: c += 1
    #print(x, c)
    res[i] = c
    vis.add(c)
    dfs(y)
dfs(1)
print(max(res))
for r in res: print(r)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
from collections import defaultdict as dd
input = sys.stdin.readline
N = int(input())
e = dd(list)
for i in range(N - 1):
  a, b = tuple(map(int, input().split()))
  e[a].append((b, i))
  e[b].append((a, i))
res = [0] * (N - 1)
vis = set()
def dfs(x):
  global vis
  global res
  viss = set()
  svis = set()
  t = 1
  for y, i in e[x]:
    if i in vis: viss.add(res[i])
  #print(x, viss)
  for y, i in e[x]:
    #print(x, y, t)
    while t in viss:
      t += 1
    if i in vis:
      continue
    #print(x, y, t)
    svis.add(y)
    vis.add(i)
    res[i] = t
    t += 1
  for y in svis:
    dfs(y)
  #print(res)
dfs(1)
print(max(res))
for r in res: print(r)
n = int(input())
a = list(map(int, input().split()))

for i in a:
  count += bin(i).rfind("1") - 1

print(count)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

count = 0
for i in a:
  count += len(bin(i)) - bin(i).rfind("1") - 1

print(count)
n = int(input())
if ord('n')>90:
  print('a')
else:
  print("A")

### FIXED CODE ###

n = input()
if n.isupper(): 
    print("A")
else :
    print('a')
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
for i in range(len(s)):
    if s[len(s)-1] == t[len(s)-1]:
        if len(s) < len(t):
            print("Yes")
        else:
            print("No")
        break
    if s[i] < t[i]:
        print("Yes")
        break
    elif s[i] == t[i]:
        continue
    else:
        print("No")
        break


### FIXED CODE ###

s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
for i in range(min(len(s),len(t))):
    if s[i] < t[i]:
        print("Yes")
        break
    elif s[i] == t[i]:
        if s[min(len(s),len(t))-1] == t[min(len(s),len(t))-1]:
            if len(s) < len(t):
                print("Yes")
                break
            else:
                print("No")
                break
        continue
    else:
        print("No")
        break
t=int(input())
import heapq
for _ in range(t):
    n=int(input())
    L=[];R=[]
    ans=0
    for _ in range(n):
        ki,li,ri = map(int, input().split())
        dif=li-ri
        if dif>=0:
            L.append((ki-1,dif))
            ans+=ri
        else:
            R.append((n-ki-1,-dif))
            ans+=li
    L.sort();R.sort()
    hL=[]
    hR=[]
    for i in range(len(L)):
        if L[i][0]>=len(hL):
            heapq.heappush(hL,L[i][1])
        elif L[i][0]==len(hL)-1:
            heapq.heappushpop(hL,L[i][1])
    for i in range(len(R)):
        if R[i][0]>=len(hR):
            heapq.heappush(hR,R[i][1])
        elif L[i][0]==len(hR)-1:
            heapq.heappushpop(hR,R[i][1])
    print(ans+sum(hL)+sum(hR))        
    
    

### FIXED CODE ###

t=int(input())
import heapq
for _ in range(t):
    n=int(input())
    L=[];R=[]
    ans=0
    for _ in range(n):
        ki,li,ri = map(int, input().split())
        dif=li-ri
        if dif>=0:
            L.append((ki-1,dif))
            ans+=ri
        else:
            R.append((n-ki-1,-dif))
            ans+=li
    L.sort();R.sort()
    hL=[]
    hR=[]
    for i in range(len(L)):
        if L[i][0]>=len(hL):
            heapq.heappush(hL,L[i][1])
        elif L[i][0]==len(hL)-1:
            heapq.heappushpop(hL,L[i][1])
    for i in range(len(R)):
        if R[i][0]>=len(hR):
            heapq.heappush(hR,R[i][1])
        elif R[i][0]==len(hR)-1:
            heapq.heappushpop(hR,R[i][1])
    print(ans+sum(hL)+sum(hR))
N = int(input())
A = map(int, input().split())
num = {i:0 for i in range(N+1)}
ans = 1
mod = 1000000007
for a in A:
    s += str(a)
    if a == 0:
        if a not in num.keys():
            num[a] = 1
            ans *= 3 %mod
        else:
            if 1 not in num.keys():
                ans *= (3 - num[a]) %mod
            num[a] += 1
    else:
        if a not in num.keys():
            num[a] = 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
        else:
            num[a] += 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
    #print(s, num, ans%mod)
print(ans%mod)

### FIXED CODE ###

N = int(input())
A = map(int, input().split())
num = {i:0 for i in range(N+1)}
num[0] = 3
ans = 1
MOD = 1000000007
for a in A:
    ans *= num[a] % MOD
    num[a] -= 1
    num[a+1] += 1
print(ans%MOD)
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D += l[i]
  if D <= x:
    c += 1
print(c)

### FIXED CODE ###

x,a = map(int,input().split())

if x<a:
  print(0)
else:
  print(10)
n = int(input())
s = [input() for i in range(n)]
for v in ['AC', 'WA', 'TLE', 'RE']:
    print(v, 'x',  a.count(v))

### FIXED CODE ###

from collections import Counter

def main():
    n = int(input())
    s = [input() for i in range(n)]
    ac = 0    
    wa = 0
    tle = 0
    re = 0
    for i in s:
        if i == 'AC':
            ac += 1
        elif i == 'WA':
            wa += 1
        elif i == 'TLE':
            tle += 1
        elif i == 'RE':
            re += 1
    print('AC x ', ac, sep='')
    print('WA x ', wa, sep='')
    print('TLE x ', tle, sep='')
    print('RE x ', re, sep='')

if __name__ == '__main__':
    main()
N=int(input())
A=list(map(int,input().split()))

while len(set(A)!=1:
#for i in range(2):
    A.sort()
    for i in range(len(A)-1):
        if A.count(0):
            A.remove(0)
            break
        A[i+1]=A[i+1]%A[0]

print(max(A))

### FIXED CODE ###

A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:print(B-A)
from collections import deque

n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n - 1):
    if a[i] != a[i + 1]:
        b.append(a[i])
if b[len(b) - 1] != a[n - 1]:
    b.append(a[n - 1])
l = len(b)
m = 0
ans = 1
for i in range(l - 1):
    if m == 0:
        if b[i] < b[i + 1]:
            m = 1
        else:
            m = -1
    elif m == 1:
        if b[i] > b[i + 1]:
            ans += 1
            m = 0
    else:
        if b[i] < b[i + 1]:
            ans += 1
            m = 0
print(ans)

### FIXED CODE ###

from collections import deque

n = int(input())
a = list(map(int, input().split()))
b = []
if n >= 2:
    for i in range(n - 1):
        if a[i] != a[i + 1]:
            b.append(a[i])
    if b[len(b) - 1] != a[n - 1]:
        b.append(a[n - 1])
    l = len(b)
    m = 0
    ans = 1
    for i in range(l - 1):
        if m == 0:
            if b[i] < b[i + 1]:
                m = 1
            else:
                m = -1
        elif m == 1:
            if b[i] > b[i + 1]:
                ans += 1
                m = 0
        else:
            if b[i] < b[i + 1]:
                ans += 1
                m = 0
else:
    ans = 1
print(ans)
n = int(input())
l = []
l.append(2)
l.append(1)
for i in range(2,n+1):
	li = l[i-2] + l[i-1]
	l.append(li)
print(li)

### FIXED CODE ###

n = int(input())
l = []
l.append(2)
l.append(1)
if n == 1:
	print(1)
else:
	for i in range(2,n+1):
		li = l[i-2] + l[i-1]
		l.append(li)
	print(li)
import sys

input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    count = [0] * (N + 1)
    for _ in range(N):
        a, b = map(int, input().split())
        count[a] += 1
        count[b] += 1

    if all(c % 2 == 0 for c in count):
        ans = "YES"
    else:
        ans = "NO"
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

input = sys.stdin.readline


def main():
    N, M = map(int, input().split())

    cnt = [0] * N
    for _ in range(M):
        a, b = map(int, input().split())
        cnt[a - 1] += 1
        cnt[b - 1] += 1

    ans = "YES"
    for c in cnt:
        if c % 2 != 0:
            ans = "NO"
    print(ans)


if __name__ == "__main__":
    main()
from collections import deque
n, m = map(int, input().split())
h = list(map(int, input().split()))
edges = [[] for i in range(m+1)]
for i in range(m):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
#print(edges)
check = [0]*n
q = deque()
for i in range(n):
    q.append(i)
ans = 0
while q:
    node = q.popleft()
    if check[node] != 0:
        continue
    else:
        check[node] = 1
        count = 0
        for v in edges[node]:
            q.append(v)
            if h[node] >= h[v]:
                check[v] = 1
                count += 1
        if count == len(edges[node]):
            ans += 1


print(ans)

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
h = list(map(int, input().split()))
edges = [[] for i in range(n+1)]
for i in range(m):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
check = [0]*n
q = deque()
for i in range(n):
    q.append(i)
ans = 0
while q:
    node = q.pop()
    if check[node] != 0:
        continue
    else:
        check[node] = 1
        count = 0
        for v in edges[node]:
            q.append(v)
            if h[node] > h[v]:
                check[v] = 1
                count += 1
            elif h[node] == h[v]:
                check[v] = 1
        if count == len(edges[node]):
            ans += 1
print(ans)
input()
a = list(map(int,input().split())
print(max(a) - min(a))

### FIXED CODE ###

input()
a = list(map(int,input().split()))
print(max(a) - min(a))
n = 10
i = 1
while x != 0 and y != 0:
 n = map(int,raw_input(),split())
 x = n[0]
 y = n[1]
 if x == 0 and y == 0:
  break
 if x >= y:
  print y,x
 else
  print x,y
 i = i + 1

### FIXED CODE ###

x = 1
y = 1
while x != 0 or y != 0:
 n = map(int,raw_input().split())
 x = n[0]
 y = n[1]
 if x == 0 and y == 0:
  break
 elif x <= y:
  print x,y
 elif x >  y:
  print y,x
N = int(input())
A = int(input())

res = N%500
if A=>res
	print("Yes")
else
	print("No")

### FIXED CODE ###

N = int(input())
A = int(input())

res = N%500
if A >= res:
	print("Yes")
else:
	print("No")
n = int(input())
h = [0]*n
for i in range(n):
  h[i] = int(input())
count = True
for i in range(n-1):
  if h[i+1]-h[i] < -1:
    count = False
    break
  elif h[i+1]-h[i] = -1:
    h[i+1] += 1
if count == True:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
count = True
for i in range(n-1):
  if h[i+1]-h[i] < -1:
    count = False
    break
  elif h[i+1]-h[i] == -1:
    h[i+1] += 1
if count == True:
  print("Yes")
else:
  print("No")
x = int(input())
for i in range(1, 361):
  if 360*i % x === 0:
    print(360*i//x)
    break
else:
  print(360)

### FIXED CODE ###

x = int(input())
for i in range(1, 361):
  if 360*i % x == 0:
    print(360*i//x)
    break
else:
  print(360)
l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    eixt()

### FIXED CODE ###

l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    exit()
k,n = map(int,input().split())
pos = list(map(int,input().split()))

#posの隣同士の差を格納
#最も差が大きいポジションに対して、CCWとCWを考えて、小さいほうを採用

#差を格納
subtract = []
for i in range(n-1):
    subtract.append(pos[i+1]-pos[i])

#差を格納(posの終点～posの始点)
subtract.append(k-pos[n-1]+pos[0])

#差の配列から、最大差のインデックス番号を取得
idx = subtract.index(max(subtract))

if idx == 0:
    rsl = k-pos[idx-1]+pos[0]
else:
    rsl = pos[n-1]-pos[0]

print(rsl)

### FIXED CODE ###

str = input()

if str[2] == str[3] and str[4] == str[5]:
    print("Yes")
else:
    print("No")
n = int(input())
s = list(map(input().split()))

r_i = [i for i, x in enumerate(s) if x=='R']
g_i = [i for i, x in enumerate(s) if x=='G']
b_i = [i for i, x in enumerate(s) if x=='B']

ans = 0

for i in len(r_i):
    for j in len(g_i):
        for k in len(b_i):
            if r_i[i]!=g_i[j] and g_i[j]!=b_i[k] and b_i[k]!=r_i[i]:
                ans += 1

print(ans)

### FIXED CODE ###

n = int(input())
s = input()

ri = [i for i, x in enumerate(s) if x=='R']
gi = [i for i, x in enumerate(s) if x=='G']
bi = [i for i, x in enumerate(s) if x=='B']

ans = len(ri) * len(gi) * len(bi)

for i in range(n):
    for d in range(n):
        j=i+d
        k=i+2*d
        if k>=n:
            break
        if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
            ans -= 1

print(ans)
from collections import Counter
c=sorted(Counter(input()).values())
print('YES' if c[0] == c[2] or c[0] + 1 == c[2] else 'NO')

### FIXED CODE ###

from collections import Counter
c=sorted(Counter(input()).values(),reverse=True) + [0] * 2
print('YES' if c[2] == c[0] or c[2] + 1 == c[0] else 'NO')
a,b,x=map(int,input().split())

def calc(n):
      p=a*n+b*len(str(n))
      return p<=x

h=10**9+1
ok=0
while h-ok>1:
      m=(h+ok)//2
      if calc(m):
            ok=m
      else:
            h=m

print(ok)


### FIXED CODE ###

s = input()
week=["SAT","FRI","THU","WED","TUE","MON","SUN"]
for i in range(0,7):
    if s == week[i]:
        print(i+1)
import sys
from collections import Counter
N = int(input())
C = Counter(list(map(int, input().split())))
if len(C) == 1 and C[0] == N:
    print('Yes')
elif len(C) == 2 and N % 3 == 0 and C[0] == N // 3 and N - [0] == 2 * N // 3:
    print('Yes')
elif len(C) == 3 and N % 3 == 0:
    b = 0
    for c in C.most_common():
        if c[1] != N // 3:
            print('No')
            sys.exit()
        b ^= c[0]
    if b == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')


### FIXED CODE ###

import sys
from collections import Counter
N = int(input())
C = Counter(list(map(int, input().split())))
if len(C) == 1 and C[0] == N:
    print('Yes')
elif len(C) == 2 and N % 3 == 0 and C[0] == N // 3 and N - C[0] == 2 * N // 3:
    print('Yes')
elif len(C) == 3 and N % 3 == 0:
    b = 0
    for c in C.most_common():
        if c[1] != N // 3:
            print('No')
            sys.exit()
        b ^= c[0]
    if b == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')