Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N, x = map(int, input().split())
A = list(map(int, input().split()))
A.extend(A)

ans = float('inf')
for k in range(N):
    cost = 0
    for i in range(N):
        cost += min(A[i:i+k+1])
    ans = min(cost + x * k, ans)

print(ans)



### FIXED CODE ###

N, x = map(int, input().split())
A = list(map(int, input().split()))
lowest_costs = A[:]
ans = float('inf')

for k in range(N):
    lowest_costs = [min(lowest_costs[i], A[i-k]) for i in range(N)]
    ans = min(sum(lowest_costs) + x * k, ans)

print(ans)
### BUGGY CODE ###

n = int(input())
t = []
a = []

for i in range(0, n):
    ti, ai = [int(_) for _ in input().split()]
    t.append(ti)
    a.append(ai)

newest_t = t[0]
newest_a = a[0]

for i in range(0, n):
    div_t = newest_t // t[i]
    div_a = newest_a // a[i]

    for j in range(min(div_t, div_a)-1, max(div_t, div_a)+2):
        if j * t[i] >= newest_t and j * a[i] >= newest_a:
            newest_t = j * t[i]
            newest_a = j * a[i]
            break

print(newest_t + newest_a)


### FIXED CODE ###

n = int(input())
t = []
a = []

for i in range(0, n):
    ti, ai = [int(_) for _ in input().split()]
    t.append(ti)
    a.append(ai)

newest_t = t[0]
newest_a = a[0]

for i in range(0, n):
    div_t = newest_t // t[i]
    div_a = newest_a // a[i]

    for j in range(max(div_t, div_a)-1, max(div_t, div_a)+2):
        if j * t[i] >= newest_t and j * a[i] >= newest_a:
            newest_t = j * t[i]
            newest_a = j * a[i]
            break

print(newest_t + newest_a)
### BUGGY CODE ###

k,s = list(map(int,input().split()))
ans = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z == s:
        ans += 1
print(ans)

### FIXED CODE ###

k,s = list(map(int,input().split()))
ans = 0
for x in range(k+1):
  for y in range(k+1):
    if s-x-y < k+1 and s-x-y >= 0:
      ans += 1
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
a = [0] + a +[0]

for i in range(n):
    d = a[i+1]
    del(a[i+1])
    c = 0
    for j in range(1,n+1):
        c += abs(a[j]-a[j-1])
    print(c)
    a.insert(i+1,d)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a = [0] + a +[0]
s = 0

for i in range(1,n+2):
    s += abs(a[i]-a[i-1])

for i in range(1,n+1):
    print(s-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1]))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

def main():
    N,K=mis()
    A=lmis()
    A.sort()
    #
    fs = factorials_list(N, N1097)
    invs = invs_list(N, fs, N1097)
    #
    ans = 0
    for i in range(N):
        if K-1 <= i:
            ans += (A[i] - A[N-1-i]) * comb(i, K-1, N1097)
    print(ans % N1097)

main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def factorial_list_mod(n, modp):
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    invs = [pow(fs[-1], modp-2, modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return fs, invs

def comb_mod(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

def main():
    N,K=mis()
    A=lmis()
    A.sort()
    #
    fs, invs = factorial_list_mod(N, N1097)
    #
    ans = 0
    for i in range(N):
        if K-1 <= i:
            ans += A[i] * comb_mod(i, K-1, N1097, fs, invs)
    A.reverse()
    for i in range(N):
        if K-1 <= i:
            ans -= A[i] * comb_mod(i, K-1, N1097, fs, invs)
    print(ans % N1097)

main()
### BUGGY CODE ###

N, Q = map(int, input().split())
T = [[0, 0, []] for _ in range(N+1)] #counter, parent, children
E = sorted([list(map(int, input().split())) for _ in range(N-1)], key=lambda x:x[0])
for e in E:
  p = e[0] if e[0] in T[1][2] else e[1]
  if 1 in e:
    p = 1
  c = e[0]+e[1]-p
  T[c][1]=p
  while True:
    T[p][2].append(c)
    if p == 1:
      break
    p = T[p][1]
for _ in range(Q):
  p, x = map(int, input().split())
  T[p][0] += x
  for c in T[p][2]:
    T[c][0] += x
ans_s = ""
for t in T[1:]:
  ans_s += "%d "%t[0]
print(ans_s)



### FIXED CODE ###

import sys
sys.setrecursionlimit(3*(10**5))


N, Q = map(int, input().split())
T = [[0, []] for _ in range(N+1)] #counter, nearest-children
E = [list(map(int, input().split())) for _ in range(N-1)]
PX = [list(map(int, input().split())) for _ in range(Q)]
for e in E:
  T[e[0]][1].append(e[1])
for px in PX:
  T[px[0]][0] += px[1]
for t in T:
  for c in t[1]:
    T[c][0] += t[0]
ans_s = ""
for t in T[1:]:
  ans_s += "%d "%t[0]
print(ans_s)
### BUGGY CODE ###

K = int(input())
count = 1
rem = 7 % K

if K % 2 == 0:
    print(-1)
elif rem % K == 0:
    print(1)
else:
    while (rem % K) != 0:
        count += 1
        rem += (7 * 10 ** (count-1)) % K
    print(count)


### FIXED CODE ###

K = int(input())
count = 1
rem = 7 % K

if K % 2 == 0:
    print(-1)
elif rem % K == 0:
    print(1)
else:
    while (rem % K) != 0 and count <= K:
        count += 1
        rem += 7 * pow(10, count-1, mod=K) % K
    if count <= K:
        print(count)
    else:
        print(-1)
### BUGGY CODE ###

n=int(input())
a=[[0]*n]*n
l=[]

for i in range(n):
  a[i]=[int(x)-1 for x in input().split()]

t=0
f=True
while f==True:
  f=False
  for i in range(n):
    if len(a[i])==0:
      continue
    f=True
    if i==a[a[i][0]][0]:
      if i<a[i][0]:
        l.append(i)
        l.append(a[i][0])

  if f==False:
    break

  if len(l)!=0:
    t+=1
    for i in range(len(l)):
      a[l.pop(0)].pop(0)
  else:
    t = -1
    break
print(t)


### FIXED CODE ###

from collections import deque

def main():
  N=int(input())
  A=[deque(int(a)-1 for a in input().split()) for _ in range(N)]

  P,W=[0]*N,[-1]*N
  c=deque(range(N))

  while c:
    i=c.popleft()
    j=A[i].popleft()
    W[i]=j

    if W[j]==i:
      P[i]=P[j]=max(P[i],P[j])+1
      if A[i]:
        c.append(i)
      if A[j]:
        c.append(j)

  print(-1 if any(len(a) for a in A) else max(P))

main()
### BUGGY CODE ###

S = input()  #文字
Q = int(input())  #数字
X = list(input().split() for i in range(Q)) #文字、複数行複数列

#print(X)

for i in range(Q):
    if X[i][0] == "1":
        S = S[::-1]
    else:
        if X[i][1] == "1":
            S = X[i][2] + S
        else:
            S = S + X[i][2]
print(S)

### FIXED CODE ###

s = input()
q = int(input())
cou = 1
frt = ""
bck = ""
for i in range(q):
    t = list(input().split())
    #logging.debug(t)#
    if t[0] == "1":
        cou *= -1
    else:
        if (t[1] == "1" and cou == 1)or(t[1] == "2" and cou == -1):
            frt = t[2] + frt
        else:
            bck = bck + t[2]
#    logging.debug("s {},cou {}".format(s,cou))

s = frt + s + bck
#logging.debug(s)#
if cou == 1:
    print(''.join(s))
else:
    print(''.join(s[::-1]))
### BUGGY CODE ###

n = int(input())
S = input()
cnt = [0] * 1000
for i in range(1000):
    key = str(i).zfill(3)
    for j in range(n):
        if S[j] == key[0]:
            for k in range(j+1, n):
                if S[k] == key[1]:
                    for l in range(k+1, n):
                        if S[l] == key[2]:
                            cnt[int(key)] += 1
                            break
                    else:
                        continue
                    break
            else:
                continue
            break
print(sum(c > 0 for c in cnt))

### FIXED CODE ###

n = int(input())
S = input()
ans = 0
def ok(i):
    pin = '{:0=3}'.format(i)
    j = 0
    for s in S:
        if s == pin[j]:
            j += 1
            if j == 3:
                return True
    else:
        return False

for i in range(1000):
    ans += ok(i)
print(ans)
### BUGGY CODE ###

import math

def isPrimeNumber(num):
    isPrimeNum = True
    for i in range(2,math.floor(math.sqrt(num)) + 1):
        if num % i == 0:
            isPrimeNum = False

    if num == 1:
        isPrimeNum = False

    return isPrimeNum

def is2017alikeNum(num):
    is2017alikeNum = False
    alikeNum = (num + 1) / 2
    if isPrimeNumber(num) and isPrimeNumber(alikeNum):
        is2017alikeNum = True
    return is2017alikeNum


N = int(input())
inputList = []
for count in range(0,N):
    l,r = map(int, input().split())
    tempList = [l,r]
    inputList.append(tempList)

for i in range(0,N):
    l = inputList[i][0]
    r = inputList[i][1]

    count = 0
    for j in range(l, r + 2 , 2):
        if is2017alikeNum(j):
            count += 1

    print(count)

### FIXED CODE ###

import math

def isPrimeNumber(num):
    isPrimeNum = True
    for i in range(2,math.floor(math.sqrt(num)) + 1):
        if num % i == 0:
            isPrimeNum = False

    if num == 1:
        isPrimeNum = False

    return isPrimeNum

def is2017alikeNum(num):
    is2017alikeNum = False
    alikeNum = (num + 1) / 2
    if isPrimeNumber(num) and isPrimeNumber(alikeNum):
        is2017alikeNum = True
    return is2017alikeNum

count = 0
list = []
for i in range(1,100000,2):
    if is2017alikeNum(i):
        count += 1
    list.append(count)

N = int(input())
inputList = []
for count in range(0,N):
    l,r = map(int, input().split())
    tempList = [l,r]
    inputList.append(tempList)

for i in range(0,N):
    l = inputList[i][0]
    r = inputList[i][1]
    lIndex = int((l-1)/2)
    rIndex = int((r-1)/2)
    if lIndex == 0:
        lIndex += 1
    x = list[rIndex] - list[lIndex-1]

    print(x)
### BUGGY CODE ###

def func(nStep:int, X) -> int:
    if X == 0:
        return 0
    nStep += 1
    newX = X % bin(X).count('1')
    if newX == 0:
        return nStep
    else:
        return func(nStep, newX)

def solve():
    N = int(input())
    X = input()
    for i in range(N):
        print(func(0, int(X,2)^(1<<(N-i-1))))

if __name__ == "__main__":
    solve()

### FIXED CODE ###

def f(n):
    if n == 0:
        return 0
    return f(n % bin(n).count("1")) + 1


def solve():
    N = int(input())
    X = input()
    p = X.count("1")
    rem_plus = 0
    rem_minus = 0
    for i in range(N):
        k = N - i - 1
        if X[i] == "0":
            continue
        elif p > 1:
            rem_minus = (rem_minus + pow(2, k, p - 1)) % (p - 1)
        rem_plus = (rem_plus + pow(2, k, p + 1)) % (p + 1)
    for i in range(N):
        k = N - i - 1
        if X[i] == "0":
            print(f((rem_plus + pow(2, k, p + 1)) % (p + 1)) + 1)
        elif p > 1:
            print(f((rem_minus - pow(2, k, p - 1)) % (p - 1)) + 1)
        else:
            print(0)


if __name__ == "__main__":
    solve()
### BUGGY CODE ###

T=input().split(" ")
a=int(T[0])
b=int(T[1])
x=int(T[2])
U=[i for i in range(a,b+1) if i%x==0]
print(len(U))

### FIXED CODE ###

T=input().split(" ")
a=int(T[0])
b=int(T[1])
x=int(T[2])
if a==0:
    print(b//x+1)
else:
    print((b//x)-((a-1)//x))
### BUGGY CODE ###

from heapq import heapify, heappush, heappop
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
A = list(map(int, input().split()))
a = heapify(A)
B = [0] * M
C = [0] * M
for i in range(M):
    B[i], C[i] = map(int, input().split())

cb = sorted(zip(C, B), reverse=True)

for c, b in cb:
    for _ in range(b):
        m = heappop(A)
        heappush(A, max(m, c))
        if m > c:
            break

print(sum(A))

### FIXED CODE ###

from heapq import heapify, heappush, heappop
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
B = [0] * M
C = [0] * M
for i in range(M):
    B[i], C[i] = map(int, input().split())

cb = sorted(zip(C, B), reverse=True)

cnt = 0
exchange = []
for c, b in cb:
    exchange.extend([c] * b)
    cnt += b
    if cnt >= N:
        break

exchange.sort()

for _ in range(len(exchange)):
    m = heappop(A)
    heappush(A, max(m, exchange.pop()))

print(sum(A))
### BUGGY CODE ###

int1 = lambda x: int(x) - 1
import sys
sys.setrecursionlimit(1000000000)

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

edge = [[0]*N for _ in range(N)]
to_point = [[] for _ in range(N)]

for _ in range(M):
    x, y = map(int1, input().split())
    edge[x][y] += 1
    to_point[x].append(y)

end_point = set()
for x in range(N):
    if len(to_point[x]) == 0:
        end_point.add(x)

start_point = set()
for y in range(N):
    for x in range(N):
        if edge[x][y] > 0:
            break
    else:
        start_point.add(y)

dp_memo = [-1]*N

# 点i始点のLongest Pathの長さ
def dp(i):
    if dp_memo[i] >= 0:
        return dp_memo[i]
    if i in end_point:
        dp_memo[i] = 0
        return 0
    else:
        lp = 0
        for j in to_point[i]:
            lp = max(lp, dp(j)+1)
        dp_memo[i] = lp
        return lp

ans = 0
for x in start_point:
    ans = max(ans, dp(x))

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(1000000000)

int1 = lambda x: int(x) - 1

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

to_point = [[] for _ in range(N)]

for _ in range(M):
    x, y = map(int1, input().split())
    to_point[x].append(y)

dp_memo = [-1]*N
for x in range(N):
    if len(to_point[x]) == 0:
        dp_memo[x] = 0

# 点i始点のLongest Pathの長さ
def dp(i):
    if dp_memo[i] >= 0:
        return dp_memo[i]
    lp = 0
    for j in to_point[i]:
        lp = max(lp, dp(j)+1)
    dp_memo[i] = lp
    return lp

for i in range(N):
    dp(i)

print(max(dp_memo))
### BUGGY CODE ###

S = input()
cnt = 0

length = len(S)
for i in range(0,len(S)-4):
  for j in range(i+4,i+4+length//2):
    if int(S[i:j+1]) % 2019 == 0 and j<length:
      cnt += 1

print(cnt)

### FIXED CODE ###

import collections
S = input()
cnt = 0

mod = [0]
reverse_S = S[::-1]
for i in range(len(reverse_S)):
  now = int(reverse_S[i]) * pow(10,i,2019)
  mod.append((now + mod[i]) % 2019)


c = collections.Counter(mod)
hindo = c.values()
for i in hindo:
  if i != 1:
    cnt += i*(i-1)//2


print(cnt)
### BUGGY CODE ###

N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))
D_flags = [True] * N
for i in range(M):
    t = T[i]
    for j in range(N):
        d = D[j]
        if t == d and D_flags[j]:
            D_flags[j] = False
            break
    else:
        print('NO')
        exit()
print('YES')

### FIXED CODE ###

from collections import defaultdict
N = int(input())
D = list(map(int, input().split()))
D_dict = defaultdict(int)
for d in D:
    D_dict[d] += 1
M = int(input())
T = list(map(int, input().split()))
T_dict = defaultdict(int)
for t in T:
    T_dict[t] += 1

for target, t_cnt in T_dict.items():
    d_cnt = D_dict[target]
    if t_cnt > d_cnt:
        print('NO')
        exit()
print('YES')
### BUGGY CODE ###

N,M=map(int,input().split())
request=[]
for _ in range(M):
    request.append(list(map(int,input().split())))
request.sort(key=lambda x: x[0])
    
memory=[]
memory.append(request[0])
head = request[0][0]
index = 0
ans = 0

def find(n,li):
    for row in li:
        if row[1]==n:return True
    return False

def equal():
    if index == M-1: return False
    else: return head == request[index+1][0]

while head <= N:
    if find(head,memory):
        ans +=1
        memory = []
    elif equal():
        index+=1
        memory.append(request[index])
    else: head +=1
        
print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
request=[]
for _ in range(M):
    request.append(list(map(int,input().split())))
request.sort(key=lambda x: x[0])
    
memory=request[0][1]
head = request[0][0]
index = 0
ans = 0

def equal():
    if index == M-1: return False
    else: return head == request[index+1][0]

while head <= N:
    if head == memory:
        ans +=1
        memory = N+1
    elif equal():
        index +=1
        memory=min(request[index][1],memory)
    else: head +=1
        
print(ans)
### BUGGY CODE ###

R, G, B, N= map(int, input().split())
c = 0
for i in range(N//R + 1):
  for j in range(N//G + 1):
    for k in range(N//B + 1):
      if R * i + G * j + B * k == N:
        c += 1
print(c)
        

### FIXED CODE ###

R, G, B, N= map(int, input().split())
c = 0
S = [R, G, B]
S.sort()
R = S[2]
G = S[1]
B = S[0]

if S[0] == 1:
  for i in range(N//R + 1):
    for j in range(N//G + 1):
      if R * i + G * j <= N:
        c += 1
else:
  for i in range(N//R + 1):
    for j in range(N//G + 1):
      for k in range(N//B + 1):
        if R * i + G * j + B * k == N:
          c += 1
print(c)
### BUGGY CODE ###

n,m=map(int,input().split())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
dp=[[1]*(m+1)for _ in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
    for j in range(1,m+1):
        dp[i][j]=dp[i-1][j]+dp[i][j-1]
        if s[i-1]!=t[j-1]:
            dp[i][j]-=dp[i-1][j-1]
        dp[i][j]%=10**9+7
print(dp[n][m])

### FIXED CODE ###

mod=10**9+7
n,m=map(int,input().split())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
dp=[(m+1)*[1]for _ in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:dp[i+1][j+1]=dp[i][j+1]+dp[i+1][j]
    else:dp[i+1][j+1]=dp[i][j+1]+dp[i+1][j]-dp[i][j]
    dp[i+1][j+1]%=mod
print(dp[-1][-1])
### BUGGY CODE ###

# ABC057 C - Digits in Multiplication
from itertools import combinations
def factorize(n):
    retlist = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
                retlist.append(i)
    if temp!=1:
        retlist.append(temp)

    if retlist==[]:
        retlist.append(n)

    return retlist

N = int(input())

ans = 10000000
L = []
L = factorize(N)
# print(L)

for i in range(1,len(L)+1):
    C = []
    C = list(combinations(L,i))
    # print(C)
    for c in C:
        a,b = 1,0
        for j in range(len(c)):
            a *= c[j]
        b = N//a
        a = str(a)
        b = str(b)
        # print('a:',a,'b:',b)
        ans = min(ans,max(len(a),len(b)))

print(ans)


### FIXED CODE ###

# ABC057 C - Digits in Multiplication
from itertools import combinations
def factorize(n):
    retlist = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
                retlist.append(i)
    if temp!=1:
        retlist.append(temp)

    if retlist==[]:
        retlist.append(n)

    return retlist

N = int(input())

ans = 10000000
L = []
L = factorize(N)
# print(L)

for i in range(1,len(L)+1):
    C = []
    C = list(combinations(L,i))
    # print(C)
    for c in C:
        a,b = 1,0
        for j in range(len(c)):
            a *= c[j]
        b = N//a
        a = str(a)
        b = str(b)
        # print('a:',a,'b:',b)
        ans = min(ans,max(len(a),len(b)))

print(ans)
### BUGGY CODE ###

#c
n,m = map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()) )
mod=10**9 + 7

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

def nCrMOD(n,r,m):
    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]
    for i in range( 2, n + 1 ):
        g1.append( ( g1[-1] * i ) % m )
        inverse.append( ( -inverse[m % i] * (m//i) ) % m )
        g2.append( (g2[-1] * inverse[-1]) % m )
    return cmb(n,r,m,g1,g2)


c=0
for i in range(m-1):
    if a[i]==a[i+1]-1: c+=1
if c!=0:
    print(0)
elif m==0:
     print( sum( nCrMOD(n-i,i,mod) for i in range(n//2+1) )%mod )
    
    
else:
    b=[a[0]-1] + [a[j+1]-a[j]-2 for j in range(m-1)] + [n-a[-1]-1]
    cc=[ sum( nCrMOD(bb-i,i,mod) for i in range(bb//2+1) )%mod for bb in b ]

    ans=1
    for ccc in cc:
        ans = ans*ccc%mod
    print(ans)

### FIXED CODE ###

#c dp version
n,m = map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()) )
from collections import deque
a=deque(a)
mod=10**9 + 7

dp=[0]*(n+2)
dp[0]=0
dp[1]=1
aa=0
if len(a)>0:
    aa=a.popleft()
for i in range(2,n+2):
    if i-1 == aa:
        dp[i]=0
        if len(a)>0:
            aa=a.popleft()
    else:
        dp[i]=( dp[i-1]+dp[i-2] )%mod
print(dp[-1])
### BUGGY CODE ###

print(sum(range(int(input()))))

### FIXED CODE ###

n=int(input())
print((n-1)*n//2)
### BUGGY CODE ###

class UnionFind:
  def __init__(self, n):
    self.parents=[i for i in range(n)]
    self.rank=[0]*n

  def find(self, x):
    if self.parents[x]==x:
      return x
    else:
      self.parents[x]=self.find(self.parents[x])
      return self.parents[x]

  def unite(self, x, y):
    x=self.find(x)
    y=self.find(y)
    if x!=y:
      if self.rank[x]<self.rank[y]:
        self.parents[x]=y
      else:
        self.parents[y]=x
        if self.rank[x]==self.rank[y]:
          self.rank[x]+=1

  def same(self,x,y):
    return self.find(x)==self.find(y)

N,M=map(int,input().split())
uf=UnionFind(N)
for _ in range(M):
  a,b=map(int,input().split())
  uf.unite(a-1,b-1)
par=uf.parents
ans=0
for p in par:
  s=par.count(p)
  ans=max(ans,s)
print(ans)

### FIXED CODE ###

def find(x):
  if par[x] < 0:
    return x
  else:
    tank = []
    while par[x] >= 0:
      tank.append(x)
      x = par[x]
    for elt in tank:
      par[elt] = x
    return x

def unite(x,y):
  x = find(x)
  y = find(y)
    
  if x == y:
    return False
  else:
    if par[x] > par[y]:
      x,y = y,x
    par[x] += par[y]
    par[y] = x
    return True

def same(x,y):
  return find(x) == find(y)

def size(x):
  return -par[find(x)]

N,M=map(int,input().split())
par = [-1]*N
for _ in range(M):
  a,b=map(int,input().split())
  unite(a-1,b-1)
print(-min(par))