Harryxun/stf_run huggingface dataset:
#整数Nを得る
N, K = map(int,input().split())
mod = 10**9 +7

for i in range(1,K+1):
    Ans = 1
    a = N - K + 1
    for j in range(1, i +1):
        Ans = int(Ans * a / j)
        a = a-1
    c = 1
    for j in range(1,i):

        c = int(c * (K - j)/j)
    
    Ans = int(Ans * c)
    Ans = Ans % mod
    print(Ans)


### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
N = 10**4
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


N, K = map(int, input().split())
R = N-K

for i in range(1, K+1):
    if i > R+1:
        print(0)
    else:
        ans = cmb(R+1, i, mod) * cmb(K-1, i-1, mod) % mod
        print(ans)
import math
R = int(input(""))
C = 2 * math.pi * R
print(C)

### FIXED CODE ###

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

x = n - sum(a)
print(x if x >= 0 else -1)
s=input()
k=int(input())
if s[0]=="1":
  print(s[1])
else:
  print(s[0])

### FIXED CODE ###

s=input()
k=int(input())

for i in range(k):
  if s[i]!="1":
    break
print(s[i])
n,W=map(int,input().split())
w=[]
v=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
V=sum(v)+1
dp=[10**10 for i in range(sum(v)+1)]
dp[0]=0
for i in range(n):
    for j in range(V,-1,-1):
        if dp[j]!=10**10:
            dp[j+v[i]]=min(dp[j+v[i]],dp[j]+w[i])
for i in range(V,-1,-1):
    if dp[i]<=W:
        print(i)
        exit()


### FIXED CODE ###

n,W=map(int,input().split())
w=[]
v=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
V=sum(v)+1
dp=[10**10 for i in range(sum(v)+1)]
dp[0]=0
for i in range(n):
    for j in range(V-1,-1,-1):
        if dp[j]!=10**10:
            dp[j+v[i]]=min(dp[j+v[i]],dp[j]+w[i])
for i in range(V-1,-1,-1):
    if dp[i]<=W:
        print(i)
        exit()
import math
from operator import mul
from functools import reduce

A,B = map(int,input().split())

maxn=math.gcd(A,B)
count=0
list=[]
def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False

  # nの平方根まで計算する
  m = math.floor(math.sqrt(n)) + 1
  for p in range(3, m, 2):
      if n % p == 0:
        return False
  return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
def cmb(n,r):
    r = min(n-r,r)
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))


### FIXED CODE ###

import math
import fractions
A,B = map(int,input().split())

maxn=fractions.gcd(A,B)
list=[]
def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    if n==3:
        return True
    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m,2):
        if n % p == 0:
            return False
    return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))
import sys
def input(): return sys.stdin.readline().rstrip()
from bisect import bisect_left,bisect_right
def main():
    x,n=map(int,input().split())
    if n==0:
        print(x)
        sys.exit()
    P=list(map(int,input().split()))
    set_P=set(range(101))
    set_P-=set(P)
    P=list(set_P)
    P.sort()
    for p in P:
        if p>=x:
            P_right=p
            break
        P_left=p
    if abs(P_left-x)<=abs(P_right-x):
        print(P_left)
    else:
        print(P_right)

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x,n=map(int,input().split())
    P = list(map(int,input().split()))
    n_lis = [0]*102
    for p in P:
        n_lis[p] += 1
    dis = 0
    while 1:
        if n_lis[x-dis] == 0:
            print(x-dis)
            break
        elif n_lis[x+dis] == 0:
            print(x+dis)
            break
        dis += 1

if __name__=='__main__':
    main()
a,b = map(open(0).read().split())

print(int(-(-(a + b) // 2)))

### FIXED CODE ###

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

if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print((a + b) // 2 + 1)
MOD = 10 ** 9 + 7


def main():
  N, K = map(int, input().strip().split())
  dp1 = {}
  dp2 = {}

  counter = {}
  i = 1
  while i < N:
    v = N // i
    j = N // v
    counter[v] = j - i + 1
    i += j - i + 1

  keys = sorted(counter.items(), reverse=True)

  total = 0
  for nj, v in keys:
    total += v
    dp1[nj] = total

  for i in range(2, K + 1):
    dp2 = {}
    # dp[i] = {}
    total = 0
    for nj, w in keys:
      j = N // nj
      v = dp1[j] * w
      total += v
      total %= MOD
      dp2[nj] = total

    dp1 = dp2

  return dp2[1]
  # for k, v in dp.items():
  #   print(k, sorted(v.items(), reverse=True))

  # return dp[K][1]


if __name__ == '__main__':
  print(main())

### FIXED CODE ###

MOD = 10 ** 9 + 7


def main(N, K):
  W = []
  i = 1
  while i <= N:
    v = N // i
    j = N // v
    # keys.append((v, j - i + 1))
    W.append(j - i + 1)
    i += j - i + 1

  l = len(W)
  dp = [0] * l

  total = 0
  for i, w in enumerate(W):
    total += w
    dp[l - i - 1] = total

  for i in range(2, K + 1):
    tmp = [0] * l
    total = 0
    for j, w in enumerate(W):
      v = dp[j] * w
      total += v
      total %= MOD
      tmp[l - j - 1] = total

    dp = tmp

  return dp[0]


if __name__ == '__main__':
  N, K = map(int, input().strip().split())
  # import time
  # t = time.time()
  print(main(N, K))
  # print(time.time() - t)
n = input()
data = []
a = []
for i in ['S', 'H', 'C', 'D']:
    for j in map(str , xrange(1, 14)):
        data.append(i + j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]

### FIXED CODE ###

n = input()
data = []
space = []
for i in ['S ', 'H ', 'C ', 'D ']:
    for j in map( str , xrange(1, 14)):
        data.append(i + j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]
N = int(input())
A = sorted(list(map(int, input().split())))
Q = int(input())
M = list(map(int, input().split()))

def exhastive_search(target, head, sum):
    for i in range(head, N):
        sum += A[i]
        if target == sum:
            return True
        elif target > sum:
            if exhastive_search(target, i+1, sum):
                return True
        else:
            return False
        sum -= A[i]
    return False


for target in M:
    head = 0
    sum = 0
    result = "no"
    for i in range(N):
        if exhastive_search(target, i, sum):
            result = "yes"
            break
    print(result)


### FIXED CODE ###

def solve(dp, a, i, m):
  if m in dp[i]:
    return dp[i][m]

  if m == 0:
    dp[i][m] = True
  elif i >= len(a):
    dp[i][m] = False
  elif solve(dp, a, i+1, m):
    dp[i][m] = True
  elif solve(dp, a, i+1, m-a[i]):
    dp[i][m] = True
  else:
    dp[i][m] = False

  return dp[i][m]

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
M = list(map(int, input().split()))

dp = {}
for i in range(N+1):
  dp[i] = {}

for m in M:
  if solve(dp, A, 0, m):
    print('yes')
  else:
    print('no')
import collections
n,m = map(int, input().split())
ps = [list(input().split()) for _ in range(m)]

q = [0]*n
t = [0]*n

for [p,s] in ps:
    p = int(p) - 1
    if s == "AC" and q[p] == 0:
        q[p] += 1
    elif s == "WA" and q[p]== 0:
        t[p] += 1

for [p,s] in ps:
    if q[p] == 0 and t[p] != 0:
        t[p] == 0


print(sum(q),sum(t))


### FIXED CODE ###

import collections
n,m = map(int, input().split())
ps = [list(input().split()) for _ in range(m)]

q = [0]*n
t = [0]*n

for [p,s] in ps:
    p = int(p) - 1
    if s == "AC" and q[p] == 0:
        q[p] += 1
    elif s == "WA" and q[p]== 0:
        t[p] += 1


"""
for [u,r] in ps:
    u = int(u) -1
    if q[u] == 0 and t[u] != 0:
        t[u] == 0
"""

w = 0
for i, uc in enumerate(q):
    if uc == 1:
        w += t[i]
    


print(sum(q),w)
# -*- coding: utf-8 -*-

N, A, B = map(int, input().split())

q, mod = divmod(N, A + B)

print((A * q) + min(mod, A)))


### FIXED CODE ###

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

N, A, B = map(int, input().split())

q, mod = divmod(N, A + B)

print((A * q) + min(mod, A))
inps = input().split()
if len(inp) >= 2:
    a = int(inps[0])
    b = int(inps[1])
    if a > b:
        print("a > b")
    elif a < b:
        print("a < b")
    else:
        print("a == b")
else:
    print("Input illegal.")

### FIXED CODE ###

inps = input().split()
if len(inps) >= 2:
    a = int(inps[0])
    b = int(inps[1])
    if a > b:
        print("a > b")
    elif a < b:
        print("a < b")
    else:
        print("a == b")
else:
    print("Input illegal.")
def main():
    D = int(input())

    if D = 22:
        print('Christmas Eve Eve Eve')
    if D = 23:
        print('Christmas Eve Eve')
    if D = 24:
        print('Christmas Eve')
    if D = 25:
        print('Christmas')

main()

### FIXED CODE ###

def main():
    D = int(input())

    if D == 22:
        print('Christmas Eve Eve Eve')
    if D == 23:
        print('Christmas Eve Eve')
    if D == 24:
        print('Christmas Eve')
    if D == 25:
        print('Christmas')

main()
import numpy as np

n = int(input())

n_list = np.arange(1, n + 1)
m_list = np.zeros(n)
m_list[:-1] = n_list[1:]
m_list[-1] = n_list[0]

kekka = 0
amari = n_list % m_list
print(int(sum(amari)))


### FIXED CODE ###

n = int(input())
 
print(int(n * (n - 1) // 2))
import sys
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix
from collections import deque
input = sys.stdin.readline


def main():
    n, m, p = map(int, input().split())
    
    tree = [[] for _ in range(n)]
    tree_back = [[] for _ in range(n)]
    
    for i in range(m):
        a, b, c = map(int, input().split())
        tree[a-1].append((b-1, c))
        tree_back[b-1].append(a-1)
    
    not_yet = deque([n-1])
    already = [False]*n
    already[n-1] = True
    while not_yet:
        key = not_yet.pop()
        for v in tree_back[key]:
            if already[v]:
                continue
            already[v] = True
            not_yet.append(v)
    
    not_yet = deque([0])
    already2 = [False]*n
    already2[0] = True
    while not_yet:
        key = not_yet.pop()
        for (v, c) in tree[key]:
            if already2[v]:
                continue
            already2[v] = True
            not_yet.append(v)
    
    
    inf = 10**9
    adjoining_list = [[inf]*n for _ in range(n)]
    for i in range(n):
        if already[i] and already2[i]:
            for (v, c) in tree[i]:
                adjoining_list[i][v] = p-c
    
    adjoining_list = np.array(adjoining_list)
    try:
        ans = bellman_ford(csr_matrix(adjoining_list))
    except:
        print(-1)
    else:
        print(max(0, int(-ans[0][n-1])))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import numpy as np
from scipy.sparse.csgraph import bellman_ford, connected_components
input = sys.stdin.readline


def main():
    n, m, p = map(int, input().split())
    
    l = np.zeros((n, n))
    for i in range(m):
        a, b, c =map(int, input().split())
        c = p-c
        if c == 0:
            c = 10**(-7.9)
        if l[a-1][b-1] == 0:
            l[a-1][b-1] = c
        else:
            l[a-1][b-1] = min(l[a-1][b-1], c)
    x = l[-1, 0]
    l[-1][0] = 10**(-7.9)
    n, labels = connected_components(l, connection="strong")
    l = l[labels == labels[0]][:, labels == labels[0]]
    l[-1, 0] = x
    
    try:
        print(max(0, int(round(bellman_ford(l, indices=0)[-1]))*(-1)))
    except:
        print(-1)


if __name__ == "__main__":
    main()
s=list(input())
t=list(input())
ss=''+join(sorted(ss))
tt=''+join(sorted(tt,reverse=true))
if ss<tt:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

ss=input()
tt=input()
s=[]
t=[]
for i in ss:
    s.append(i)
for i in tt:
    t.append(i)
sss=sorted(s)
ttt=sorted(t)
ssss=""
tttt=""
for i in sss:
    ssss+=i
for i in range(len(ttt)):
    tttt+=ttt[len(ttt)-i-1]
if ssss<tttt:
    print("Yes")
else:
    print("No")
S = input().
a = S.count('o')
print(700 + 100 * a)

### FIXED CODE ###

S = input()
a = S.count('o')
print(700 + 100 * a)
def permutation(n,k,mod):
    ans=1
    for i in range(k):
        ans*=(n-i)%mod
        ans%=ans
    return ans
num_vertax,num_coler=map(int,input().split())
ver_array=[[i+1,[]] for i in range(num_vertax)]
for i in range(num_vertax-1):
    a,b=map(int,input().split())
    ver_array[a-1][1].append(ver_array[b-1][0])
    ver_array[b-1][1].append(ver_array[a-1][0])
ans=num_coler
top=1
for ver in ver_array:
    ans*=permutation(num_coler-2+top,len(ver[1])+top-1,1000000007)%1000000007
    top=0
print(ans%1000000007)

### FIXED CODE ###

N,K=map(int,input().split())
mod=1000000007
path=[[] for i in range(N)]
for i in range(N-1):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  path[a].append(b)
  path[b].append(a)
#print(path)
  
abc=[False for i in range(N)] #0ならまだ塗ってない
 
abc[0]=True
cnt=0
ans=K%mod
nx=[]
for i in range(len(path[0])):
  child=path[0][i]
  if abc[child]:
    continue
  ans=ans*(K-1-cnt)
  ans=ans%mod
  cnt=cnt+1
  abc[child]=True
  nx.append(child)
while len(nx)>0:
  a=nx.pop()
  cnt=0
  for i in range(len(path[a])):
    child=path[a][i]
    if abc[child]:
      continue
    ans=ans*(K-2-cnt)
    ans=ans%mod
    cnt=cnt+1
    abc[child]=True
    nx.append(child)
      
print(ans%mod)
def merge(A, left, mid, right):
    L = A[left:mid] + [1000000]
    R = A[mid:right] + [1000000]
    # L.append(1000000)
    # R.append(1000000)

    i = 0
    j = 0
    global count
    
    for k in range(left, right):
        count += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

# def merge(A, left, mid, right):
#     global count
#     inf = 10 ** 9
#     L = A[left:mid] + [inf]
#     R = A[mid:right] + [inf]
 
#     i = 0
#     j = 0
#     for k in range(left, right):
#         count += 1
#         # print(L)
#         # print(R)
#         if L[i] <= R[j]:
#             A[k] = L[i]
#             i += 1
#         else:
#             A[k] = R[j]
#             j += 1

def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

n = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, n)

print(' '.join(list(map(str, A))))
print(count)


### FIXED CODE ###

def merge(A, left, mid, right):
    global count
    inf = 10 ** 9
    L = A[left:mid] + [inf]
    R = A[mid:right] + [inf]

    i = 0
    j = 0
    for k in range(left, right):
        count += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

n = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, n)

print(' '.join(list(map(str, A))))
print(count)
h=input()
a=input()
H = int(h)
A= int(a)
n = H // A + 1
print(n)

### FIXED CODE ###

H,A =input().split()
h = int(H)
a = int(A)
if h % a == 0:
    n = h // a
else:
    n = h // a +1
print(n)
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i
			if v<10050:
				ans[v]+=1
for i in range(n):
	print(ans[i+1])

### FIXED CODE ###

L,R,d=input().split()

count=0
for i in range(int(L),int(R)+1,1):
    if i%int(d)==0:
        count+=1

print(count)
N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
s = ("b"*B + "r"*R)
s1 = s[:(k)]
print(k2*(B) + s1.count("b"))


### FIXED CODE ###

N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
#s = ("b"*B + "r"*R)

#s1 = s[:k]
if k <= B:
	print(k2*(B) + k)
else:
	print(k2*(B) + B)
import sys
from collections import Counter
from heapq import heapify, heappop, heappush
read = sys.stdin.read

N, K, *td = map(int, read().split())
dt = sorted(zip(td[1::2], td[::2]), reverse=True)

candidates = []
neta_group = Counter([j for i, j in dt[:K]])
number = len(neta_group)
points = sum([i for i, j in dt[:K]]) + number ** 2
candidates.append(points)

heap = [(-i, j) for i, j in dt[K:]]
heapify(heap)
manzoku = dt[:K]
heapify(manzoku)

if N != K:
    while heap:
        oishisa, neta = heappop(heap)
        oishisa = -oishisa
        if not neta_group.get(neta):
            oishisa2, neta2 = heappop(manzoku)
            if neta_group[neta2] == 1:
                heappush(heap, (-oishisa2, neta2))
            else:
                neta_group[neta2] -= 1
                neta_group[neta] = 1
                heappush(heap, (-oishisa, neta))
                points = points - oishisa2 + oishisa - number ** 2 + (number + 1) ** 2

                number += 1
                candidates.append(points)

print(max(candidates))

### FIXED CODE ###

import sys
from operator import itemgetter
read = sys.stdin.read

N, K, *td = map(int, read().split())
td = sorted(zip(*[iter(td)] * 2), key=itemgetter(1), reverse=True)

stack = []
taste = 0
neta_group = set()
for t, d in td[:K]:
    taste += d
    if t in neta_group:
        stack.append(d)
    else:
        neta_group.add(t)

variety = len(neta_group)
candidates = [taste + variety ** 2]

if N == K:
    print(candidates[0])
    exit()

rest = list(reversed(td[K::]))

while rest and stack:
    t1, d1 = rest.pop()
    if t1 not in neta_group:
        neta_group.add(t1)
        d2 = stack.pop()
        variety += 1
        taste = taste - d2 + d1

        candidates.append(taste + variety ** 2)

print(max(candidates))
import math
a,b,c = map(int,input().split())
if math.squrt(a)+math.squrt(b) < math.squrt(c):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int,input().split())
if c-a-b>0 and 4*a*b<(c-a-b)**2:
    print('Yes')
else:
    print("No")
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd
import numpy as np


def lcm(a, b):
    return a * b // gcd(a, b)

mod = 2019

if __name__ == "__main__":
    l=[]
    L,R= map(int, sys.stdin.readline().split())
    if R-L>2019:
        R=L+2018
    else:
        ans=2019
        for i in range(L,R):
            if i%mod==0:
                pass
            else:
                for j in range(i+1,R+1):
                    ans=min(ans,(j*i)%mod)
                # l=[(j*i)%mod for j in range(L+1,R)]
    print(ans)

### FIXED CODE ###

L, R = map(int, input().split())
if R - L >= 2018:
	print(0)
else:
	ans = 2019
	for i in range(L, R):
		for j in range(i + 1, R + 1):
			ans = min(ans, i * j % 2019)
	print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Z = []
for i in range(1, N):
    Z.append(abs(A[i] - A[i - 1]))
Z.sort()
ans = -1
for i in range(1, N - 1):
    if Z[i - 1] % Z[i] != 0:
        ans = 1
        break
for i in A:
    if K == i:
        ans = 1
if K >= max(A):
    ans = -1
if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
import copy
Z = copy.deepcopy(A)
#for i in range(1, N):
 #   Z.append(abs(A[i] - A[i - 1]))
Z.sort()
i = 0

while True:
    if i >= len(Z):
        break
    if Z[i] == 0:
        del Z[i]
        i -= 1
    elif i > 0 and Z[i] == Z[i - 1]:
        del Z[i]
        i -= 1
    i += 1

ans = -1

import fractions
gcd = Z[0]
for i in range(1, len(Z)):
    gcd = fractions.gcd(gcd, Z[i])

if K % gcd == 0:
    ans = 1
    
if K > max(A):
    ans = -1
       
for i in A:
    if K == i:
        ans = 1
        break

if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
N = int(input())
A = list(map(int,input().split()))

A_sum = A.copy()
cur_len = 1
count = N
ans = N
while cur_len <= N and count > 0:
    for i in range(N-cur_len):
        if A_sum[i] >= 0 and A_sum[i] ^ A[i+cur_len] == A_sum[i] + A[i+cur_len]:
            A_sum[i] = A_sum[i] + A[i+cur_len]
        elif A_sum[i] >= 0:
            A_sum[i] = -1
            count -= 1
    if A_sum[N-cur_len] >= 0:
        A_sum[N-cur_len] = -1
        count -= 1
    cur_len += 1
    ans += count
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
L = 0
R = 0
S = A[0]
ans = 0
while(R < N-1):
    if S + A[R+1] == S ^ A[R+1]:
        S += A[R+1]
        R+= 1
    elif R > L:
        S -= A[L]
        ans += R - L + 1
        L += 1
    else:
        L += 1
        R += 1
        ans += 1
        S = A[L]
print(ans+(R-L+2)*(R-L+1)//2)
s = input()
nokori = 15 -len(s)
should = 8 -nokori 
num = s.count("o")
if num >= should:
  print("YES")
else:
  print(""NO)

### FIXED CODE ###

s = input()
nokori = 15 -len(s)
should = 8 -nokori 
num = s.count("o")
if num >= should:
  print("YES")
else:
  print("NO")
n,m=map(int, input().split())
l=[]
cnt=0
for i in range(m):
    s,c=map(int, input().split())
    l.append([s,c])
    if s==1 and c==0: #最上位の位が1の時に対する処理
        cnt+=1
buf=0
for i in range(m-1):
    for j in range(i+1,m):
        if l[i][0]==l[j][0] and l[i][1]!=l[j][1]:
            buf+=1
if buf!=0 or cnt!=0:
    print('-1')
else:
    l.sort()
    ans=l[0][1]*(10**(3-l[0][0]))
    for i in range(1,m):
        if l[i-1][0]==l[i][0]:
            continue
        else:
            ans+=l[i][1]*(10**(3-l[i][0]))
    print(ans)

### FIXED CODE ###

import sys
n,m=map(int,input().split())
ans=[0]*n
scash=[]
buf=0
for i in range(m):
    s,c=map(int,input().split())
    if s not in scash:
        ans[s-1]+=c
        scash.append(s)
    elif (s in scash) and c!=ans[s-1]:
        buf+=1
        scash.append(s)
if n==1 and ans[0]==0:
    print(0)
    sys.exit()
if buf==0 and ans[0]!=0:
    anstr=[str(num) for num in ans]
    print(''.join(anstr))
elif buf==0 and (1 not in scash):
    ans[0]+=1
    anstr=[str(num) for num in ans]
    print(''.join(anstr))
else:
    print(-1)
A,B = map(int, input().split())
 
if 6 <= A and A < 13:
  B /= 2
else if A < 6:
  B = 0
  
print(B)

### FIXED CODE ###

A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))
n = int(input())
words = ['']*n
for i in range(n):
    words[i] = input()
for i in range(len(words) - 1):
    if words.count(words[i]) > 1 or words[i][-1] != words[i+1][0]:
        print('No')
        exit()
print('Yes')

### FIXED CODE ###

def Condition(W):
    for i in range(len(W)):
        for j in range(i,len(W)):
            if W[i]==W[j] and i!=j:
                print('No')
                return None
    for i in range(len(W)-1):
        k=len(W[i])-1
        if W[i][k]!=W[i+1][0]:
            print('No')
            return None
    print('Yes')    


N=int(input())
W=[]
for i in range (N):
    W.append(input())    
Condition(W)