Harryxun/stf_run huggingface dataset:
class Comb:
    m_vals = []
    _mod = 1_000_000_007
    _mod2 = 1_000_000_005

    def __init__(self, n: int, r: int):
        m_ls = [1] * (r + 1)

        for i, j in zip(range(n, 0, -1), range(1, r + 1)):
            m_ls[j] = (m_ls[j - 1] * i * pow(j, self._mod2, self._mod)) % self._mod

        self.m_vals = m_ls

    def vv(self, x):
        return self.m_vals[x]


def main():
    n, a, b = map(int, input().split())
    _mod = 1_000_000_007
    cmb = Comb(n, b)
    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - cmb.vv(a)) + (_mod - cmb.vv(b))
    ans %= _mod

    print(ans)


main()


### FIXED CODE ###


def create_array(n: int, r: int, mod, mod2):
    m_ls = [1] * (r + 1)

    for i, j in zip(range(n, 0, -1), range(1, r + 1)):
        m_ls[j] = (m_ls[j - 1] * i * pow(j, mod2, mod)) % mod
    return m_ls


def main():
    n, a, b = map(int, input().split())
    _mod = 1000000007
    _mod2 = 1000000005

    m_ls = create_array(n, b, _mod, _mod2)

    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - m_ls[a]) + (_mod - m_ls[b])
    ans %= _mod

    print(ans)


main()
N,X=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
ans=1
for i in range(N):
	tmp+=L[i]
	if tmp>X:
		print(ans)
		exit()
	else:
		ans+=1
print(ans)

### FIXED CODE ###

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

if X<A :
	print(0)
else:
	print(10)
N = int(input())
S, P = ['0']*N, [0]*N
SP = []
for i in range(N):
    tmp_s, tmp_p = map(str, input().split())
    S[i], P[i] = tmp_s, tmp_p
    SP.append((tmp_s,int(tmp_p)))

# 点数で逆順ソート
SSP = sorted(SP, key=itemgetter(1), reverse=True)
# 名前で昇順ソート
SSP = sorted(SSP, key=itemgetter(0))

answer = [0]*N
for i in range(N):
    for j in range(N):
        if SSP[i] == SP[j]:
            answer[i] = j+1

for i in answer:
    print(i)

### FIXED CODE ###

from operator import itemgetter

# input
N = int(input())
S, P = ['0']*N, [0]*N
SP = []
for i in range(N):
    tmp_s, tmp_p = map(str, input().split())
    S[i], P[i] = tmp_s, tmp_p
    SP.append((tmp_s,int(tmp_p)))

# 点数で逆順ソート
SSP = sorted(SP, key=itemgetter(1), reverse=True)
# 名前で昇順ソート
SSP = sorted(SSP, key=itemgetter(0))

answer = [0]*N
for i in range(N):
    for j in range(N):
        if SSP[i] == SP[j]:
            answer[i] = j+1

for i in answer:
    print(i)
n,k=map(int,input().split())
S=input()
c=0
d=0
for i in range(n):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1
print(c+2*k-1 if d<=k and S[0]==S[-1] else c+2*k)

### FIXED CODE ###

n,k=map(int,input().split())
S=input()
c=0
d=0
for i in range(n-1):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1
d=(d+1)//2
print(c+2*d-1 if (d<=k and S[0]!=S[-1]) else c+2*min(d,k))
a = input()
b = input()
c== 0
if a[0] = b[0]:
  c = c+1
if a[1] = b[1]:
  c= c+1
ifa[2] = b[2]:
  c= c+1
print(c)

### FIXED CODE ###

def compare(a, b):
    c=0
    for x, y in zip(a, b):
        if x == y:
          c += 1
    return c
x = input()
y = input()
print(compare(x,y))
s = input()

c1, c2, c3 = False, False, True

if s[0] == 'A':
    c1 = True

if s[2:-2].count('C') == 1:
    c2 = True

index = [i for i in range(1, len(s))]
for i, st in enumerate(s[1:]):
    if st == 'C':
        index.pop(i)

for idx in index:
    if s[idx].islower():
        continue
    else:
        c3 = False
        break

if c1 and c2 and c3:
    print('AC')
else:
    print('WA')

### FIXED CODE ###

s = input()

c1, c2 = False, False

if s[0] == 'A':
    c1 = True

if s[2:-1].count('C') == 1:
    c2 = True

s_lower = s[1:].replace('C', 'c')
c3 = s_lower.islower()

if c1 and c2 and c3:
    print('AC')
else:
    print('WA')
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
b.sort()
c.sort()
i,j,k=0
ans=0
while i<n and j<n and k<n:
  while j<n and a[i]>=b[j]:
    j+=1
  if j==n:
    break
  while k<n and b[j]>=c[k]:
    k+=1
  if k==n:
    break
  ans+=1
  i+=1
  j+=1
  k+=1
print(ans)


### FIXED CODE ###

import bisect
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
b.sort()
c.sort()
ans=0
for i in range(n):
  j=bisect.bisect_left(a,b[i])
  k=n-bisect.bisect_right(c,b[i])
  ans+=j*k
print(ans)
s = int(input())
a = [0 for i in range(1000001)]
a[s] = 1
ai = s
i = 2
while True:
  if ai % 2 == 0:
    ai /= 2
  else:
    ai = 3 * ai + 1
  if a[ai] > 0:
    print(i)
    break
  else:
    a[ai] = 1
    i += 1


### FIXED CODE ###

s = int(input())
a = [0 for i in range(1000001)]
a[s] = 1
ai = s
i = 2
while True:
  if ai % 2 == 0:
    ai //= 2
  else:
    ai = 3 * ai + 1
  if a[ai] > 0:
    print(i)
    break
  else:
    a[ai] = 1
    i += 1
N = int(input())
S = list(map(int,input().split()))
H = list(map(int,input().split()))
T = S[0]
A = S[1]
sub = abs(A - (T - H[0]*0.006))
for x in range(0,N):
    H_sub = abs(A -(T - H[x]*0.006))
    if H_sub < sub:
        sub = H_sub
        X = x
print(X+1)

### FIXED CODE ###

N = int(input())
S = list(map(int,input().split()))
H = list(map(int,input().split()))
T = S[0]
A = S[1]
sub = abs(A - (T - H[0]*0.006))
for x in range(0,N):
    H_sub = abs(A -(T - H[x]*0.006))
    if H_sub <= sub:
        sub = H_sub
        X = x
print(X+1)
n=int(input())
v=int(x) for x in input().split()
c=int(y) for y in input().split()
e=[i for i in range(n) if (v[i]-c[i])>0]
ans=sum(e)
print(ans)

### FIXED CODE ###

n=int(input())
v=list(int(x) for x in input().split())
c=list(int(y) for y in input().split())
e=[]
for i in range(n):
	if (v[i]-c[i])>0:
		e.append(v[i]-c[i])
ans=sum(e)
print(ans)
while(1):
  count = input()
  if count == 0: break
  previous_cube = [1, 2, 3, 4, 5, 6]
  operation{'North':[2, 6, 3, 4, 1, 5], 'East':[4, 2, 1, 6, 5, 3], 'West': [3, 2, 6, 1, 5, 4], 'South':[5, 1, 3, 4, 6, 2], 'Right':[1, 3, 5, 2, 4, 6], 'Left[1, 4, 2, 5, 3, 6]}
  sum = 1
  for i in xrange(count):
    new_cube = []
    for i in xrange(6):
      new_cube.append(previous_cube[operation[raw_input()][i]])
    sum += new_cube[0]
    previous_cube = new_cube
  print sum

### FIXED CODE ###

while 1:
  n = input()
  if n == 0:  break
  d = range(1, 7)
  ans = 1
  for i in range(n):
    c = raw_input()[0]
    if c == 'N': S = [1,5,2,3,0,4]
    elif c == "S": S = [4,0,2,3,5,1]
    elif c == "E": S = [3,1,0,5,4,2]
    elif c == "W": S = [2,1,5,0,4,3]
    elif c == "R": S = [0,2,4,1,3,5]
    elif c == "L": S = [0,3,1,4,2,5]
    d = [d[s] for s in S]
    ans += d[0]
  print ans
import math
def divide(A,B,C,D,E):
  F = [B,C,D,E]
  F.sort()
  tail = F[-1]
  F = F[:-1]
  G = 1
  for i in range(A-tail):
    G *= A - i
  for f in F:
    G /= f
  return G
N,A,B,K = map(int, input().split())
count = 0
Nf = math.factorial(N)
P = []
c = 0
while c < N:
  if K % B == 0:
    if K//B <= N:
      print((c, K//B))
      P.append([c, K//B])
  K -= A
  c += 1
for p in P:
  for G in range(min(p[0],p[1]) + 1):
    W = N - p[0] - p[1] + G
    if W >= 0:
      #divider = math.factorial(p[0]-G) * math.factorial(p[1]-G) * math.factorial(G) * math.factorial(W)
      pattern = divide(Nf, math.factorial(p[0]-G), math.factorial(p[1]-G), math.factorial(G), math.factorial(W))
      count += pattern
count *= 10 ** k
if count > 998244353:
  count = count % 998244353
print(count)

### FIXED CODE ###

def fib(n, p):
  F = [1] * (n + 1)
  for i in range(2, n + 1):
    F[i] = F[i - 1] * i % p
  return F
def finv(F, p):
  N = len(F) - 1
  Finv = list(F)
  Finv[-1] = pow(F[-1], p - 2, p)
  for i in range(N - 1, -1, -1):
    Finv[i] = Finv[i + 1] * (i + 1) % p
  return Finv
def comb(F, Finv, n, a, p):
  return F[n] * Finv[a] * Finv[n - a] % p
N, A, B, K = map(int, input().split())
p = 998244353
F = fib(N, p)
Finv = finv(F, p)
cnt = 0
for a in range(min(N + 1, K // A + 1)):
  _A = A * a
  if _A > K:
    continue
  if (K - _A) % B > 0:
    continue
  b = (K - _A) // B
  if b > N:
    continue
  cnt += comb(F, Finv, N, a, p) * comb(F, Finv, N, b, p)
  cnt %= p
print(cnt)
a, b, k = map(int, input().split())
arr = list(range(a, b+1))
for i in sorted(set(arr[:k]+arr[-k:])):
    print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())
arr = range(a, b+1)
for i in sorted(set(arr[:k]) | set(arr[-k:])):
    print(i)
iranai = [int(i) for i in input().split()]
iru = [[int(i) for i in input().split()] for i in range(iranai[0])]
mikitani = []
son = []
num = 0
mikicount = 0

for i in range(iranai[0]):
    for i2 in range(iranai[1]):
        num += iru[i][i2]
    mikitani.append(num)
    num = 0

for i in range(iranai[1]):
    for i2 in range(iranai[0]):
        num += iru[i2][i]
    son.append(num)
    num = 0

for i in range(iranai[0]):
    for i2 in range(iranai[1]):
        print(iru[i][i2],end=" ")
        if i2 = iranai[2]-1:
            print(mikitani[i])
    mikicount += mikitani[i]
son.append(mikicount)

for i in range(len(son)):
    if i == len(son)-1:
        print(son[i])
    else:
        print(son[i],end=" ")

### FIXED CODE ###

iranai = [int(i) for i in input().split()]
iru = [[int(i) for i in input().split()] for i in range(iranai[0])]
mikitani = []
son = []
num = 0
mikicount = 0
for i in range(iranai[0]):
    for i2 in range(iranai[1]):
        num += iru[i][i2]
    mikitani.append(num)
    num = 0

for i in range(iranai[1]):
    for i2 in range(iranai[0]):
        num += iru[i2][i]
    son.append(num)
    num = 0

for i in range(iranai[0]):
    for i2 in range(iranai[1]):
        print(iru[i][i2],end=" ")
        if i2 == iranai[1]-1:
            print(mikitani[i])
    mikicount += mikitani[i]
son.append(mikicount)

for i in range(len(son)):
    if i == len(son)-1:
        print(son[i])
    else:
        print(son[i],end=" ")
n, k = map(int, input().split())
a = list(map(int, input().split()))

if all(i<=0 for i in a) or n==k:
    a.sort(reverse=True)
    res = 1
    mod = 10**9 + 7
    for i in range(k):
        res = (res*a[i])%mod
    print(res)
else:
    mainas = []
    plus = []
    for i in range(n):
        if a[i] < 0: mainas.append(a[i])
        else: plus.append(a[i])
        
    mainas.sort()
    mainas.extend([0,0])
    plus.extend([0,0])
    plus.sort(reverse=True)

    m, p = 0,0
    r = []
    while k > 1:
        if mainas[p]*mainas[p+1] < plus[m]*plus[m+1]:
            r.extend(plus[m:m+2])
            m += 2
        else:
            r.extend(mainas[p:p+2])
            p += 2
        k -= 2

    if k == 1:
        r.append(plus[m])

    res = 1
    mod = 10**9 + 7
    for i in r:
        res = (res*i)%mod
    print(res)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10**9 + 7
res = 1
a.sort(reverse=True)
if a[0]<0 and k%2==1:
    for i in range(k):
        res = (res*a[i])%mod
else:
    right = n-1
    left = 0
    while k > 1:
        if a[right]*a[right-1] < a[left]*a[left+1]:
            res = (res*a[left])%mod
            left += 1
            k -= 1
        else:
            res = (res*a[right]*a[right-1])%mod
            right -= 2
            k -= 2
    if k == 1:
        res = (res*a[left])%mod

print(res)
import sys
N, M = list(map(int, input().split()))

a = []
m = 1000000
for i in range(M):
    l, r, d = list(map(int, input().split()))
    if l > r:
        d = -d
        l,r = r,l
    m = min(m, l)
    a.append(tuple(l,r,d))
a = sorted(a, lambda t: t[0])
d = {}
d[m] = True
p[m] = 0
p = [0 for _ in range(N)]

for i in range(M):
    if (a[i][0] in d) and (a[i][1] in d):
        if ((a[i][1] - a[i][0]) != a[i][2]):
            print('No')
            sys.exit()
    elif (a[i][0] not in d) and (a[i][1] in d):
        np = p[a[i][1]] - a[i][2]
        p[a[i][0]] = np
        d[a[i][0]] = True
    elif (a[i][0] in d) and (a[i][1] not in d):
        np = p[a[i][0]] + a[i][2]
        p[a[i][1]] = np
        d[a[i][1]] = True
    else:
        p[a[i][1]] = 0
        d[a[i][1]] = True

        np = p[a[i][1]] - a[i][2]
        p[a[i][0]] = np
        d[a[i][0]] = True
print('Yes')


### FIXED CODE ###

import sys
sys.setrecursionlimit(200002)


def dfs(i, c):
    C[i] = True
    P[i] = c
    for t in G[i]:
        if (C[t[0]] == True):
            continue
        dfs(t[0], c+t[1])
    return


N, M = list(map(int, input().split()))
G = [[] for _ in range(N+1)]
P = [None for _ in range(N+1)]
C = [False for _ in range(N+1)]

for i in range(M):
    l, r, d = list(map(int, input().split()))
    G[l].append((r,d))
    G[r].append((l,-d))

for i in range(1, N+1):
    if (C[i] == False):
        dfs(i,0)

f = False
for i in range(1, N+1):
    for t in G[i]:
        if ((P[t[0]] - P[i]) != t[1]):
            f = True
if (f):
    print('No')
else:
    print('Yes')
a, b = map(int, input().split())
x = a + b
y = a - b
z = a * b
O = [x,y,z]
O = sorted(O,reverse=1)
print(O[0]

### FIXED CODE ###


a, b = map(int, input().split())
x = a + b
y = a - b
z = a * b
O = [x,y,z]
O = sorted(O,reverse=1)
print(O[0])
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

N =ni()
A=na()
ma = max(A)
ma_in = A.index(ma)
mi = min(A)
mi_in = A.index(mi)
c=0
P=[]

if(ma==mi):
    pass

elif(ma<=0):
    for i in reversed(range((1,N))):
        P.append([i+1,i])

elif(mi>=0):
    for i in range(1,N):
        P.append([i,i+1])
else:
    if(abs(ma)>=abs(mi)):
        for i in range(N):
            if(A[i]<0):
                A[i]+=ma
                P.append([ma_in+1,i+1])
        for i in range(1,N):
            P.append([i,i+1])
            #A[i+1]+=A[i]
    else:
        for i in range(N):
            if(A[i]>0):
                A[i]+=mi
                P.append([mi_in+1,i+1])
        for i in reversed(range(1,N)):
            P.append([i+1,i])
print(len(P))
for p in P:
    print(p[0],p[1])

### FIXED CODE ###

import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

N =ni()
A=na()
ma = max(A)
ma_in = A.index(ma)
mi = min(A)
mi_in = A.index(mi)
P=[]
if(ma==mi):
    pass
elif(ma<=0):
    for i in reversed(range(1,N)):
        P.append([i+1,i])
elif(mi>=0):
    for i in range(1,N):
        P.append([i,i+1])
else:
    if(abs(ma)>=abs(mi)):
        for i in range(N):
            if(A[i]<0):
                A[i]+=ma
                P.append([ma_in+1,i+1])
        for i in range(1,N):
            P.append([i,i+1])
            #A[i+1]+=A[i]
    elif(abs(ma)<=abs(mi)):
        for i in range(N):
            if(A[i]>0):
                A[i]+=mi
                P.append([mi_in+1,i+1])
        for i in reversed(range(1,N)):
            P.append([i+1,i])
print(len(P))
for p in P:
    print(p[0],p[1])
#[int(x) for x in input().split()]
#map(int,input().split())
#for _ in range(int(input())):
x=input()
l=list(x)
c=0
for i in range(len(l)):
	if l[i]=='?':
		if i-1<0:
			if l[i+1]=='D':
				l[i]='P'
			elif l[i+1]=='?':
				l[i]='P'
			else:
				l[i]='D'
		elif l[i-1]=='P':
			l[i]='D'
		elif i+1<len(l):
			if l[i+1]=='D':
				l[i]='P'
			elif l[i+1]=='?':
				l[i]='P'
			else:
				l[i]='D'
		else:
			l[i]='D'
print(''.join(l))


### FIXED CODE ###

#[int(x) for x in input().split()]
#map(int,input().split())
#for _ in range(int(input())):
x=input()
l=list(x)
c=0
for i in range(len(l)):
	if l[i]=='?':
		if i-1<0:
			if i+1<len(l):
				if l[i+1]=='D':
					l[i]='P'
				elif l[i+1]=='?':
					l[i]='P'
				else:
					l[i]='D'
			else:
				l[i]='D'
		elif l[i-1]=='P':
			l[i]='D'
		elif i+1<len(l):
			if l[i+1]=='D':
				l[i]='P'
			elif l[i+1]=='?':
				l[i]='P'
			else:
				l[i]='D'
		else:
			l[i]='D'
print(''.join(l))
n,q = map(int, input().split())

root_list = [i for i in range(n)]

def root(x):
    path_to_root = []
    while root_list[x] != x:
        path_to_root.append(x):
        x = root_list[x]
    for node in path_to_root:
        root_list[node] = x
    return x

def is_same_set(x,y):
    return root(x) == root(y)

def unite(x,y):
    root_list[root(x)] = root(y)

for _ in range(q):
    com, x, y = map(int, input().split())
    if com == 0:
        #unite
        unite(x,y)
    else:
        if is_same_set(x,y):
            print(1)
        else:
            print(0)


### FIXED CODE ###

n,q = map(int, input().split())

root_list = [i for i in range(n)]

def root(x):
    path_to_root = []
    while root_list[x] != x:
        path_to_root.append(x)
        x = root_list[x]
    for node in path_to_root:
        root_list[node] = x
    return x

def is_same_set(x,y):
    return root(x) == root(y)

def unite(x,y):
    root_list[root(x)] = root(y)

for _ in range(q):
    com, x, y = map(int, input().split())
    if com == 0:
        #unite
        unite(x,y)
    else:
        if is_same_set(x,y):
            print(1)
        else:
            print(0)
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return int((A * B)/C)

N = int(input())

T = []

for _ in range(N):
    T.append(int(input()))

T = sorted(T)
C = T[0]

for i in range(1, N):
    C = a(C, T[i])
print(C)


### FIXED CODE ###

import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return (A * B)//C

N = int(input())

T = []

for _ in range(N):
    T.append(int(input()))

T = sorted(T)
C = T[0]

if N > 1:
    for i in range(1, N):
        C = a(C, T[i])
print(C)
N = int(input())
p = []
for i in range(N):
        p.append(int(input())
sum  = 0
max_value = max(p)
p.remove(max_value)

sum += max_value/2

for i in p:
        sum += i

print(sum)

### FIXED CODE ###

N = int(input())
p = []
for i in range(N):
        p.append(int(input()))
sum  = 0
max_value = max(p)
p.remove(max_value)

sum += max_value/2

for i in p:
        sum += i

print(int(sum))
N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

  
if one =< four:
  print('Yes')
else :
  if two == 0:
    if four == one-1:
      print('Yes')
    else:
      print('No')
  else:
    print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

print("Yes" if four >= one or (four == one - 1 and two == 0) else "No")
n, x = map(int, input().split())
l = ["P"]
def lvup(n):
  if n == 0:
    pass
  else:
    lvup(n-1)
    l.append("B"+l[n-1]+"P"+l[n-1]+"B")
lvup(n)
print(l[n][0:x].count("P"))


### FIXED CODE ###

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

def count_p(n, x):
  if x == 0:
    return 0
  elif n == 0:
    return 1
  elif x > 2**(n+1)-2:
    return 2**(n)-1 + 1 + count_p(n-1, min(x-(2**(n+1)-1), 2**(n+1)-3))
  else:
    return count_p(n-1, x-1)
  
print(count_p(n,x))
from itertools import combinations

n = int(input())
balls = []
cost = n
for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

for b1, b2 in combinations(balls, 2):
    p, q = b1[0] - b2[0], b1[1] - b2[1]
    if p != 0 or q != 0:
        sub = 0
        for ball in balls:
            bx, by = ball
            dx, dy = bx - b2[0], by - b2[1]
            if dx % p == 0 and dy % q == 0 and dx // p == dy // q:
                sub += 1
        cost = min(cost, n - sub)

print(max(cost, 1))

### FIXED CODE ###

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

dic = dict()
for cx, cy in xy:
    for x, y in xy:
        if cx != x or cy != y:
            w = (x-cx,y-cy)
            if dic.get(w) is None:
                dic[w] = 0
            dic[w] += 1

cnt = 1
m = 0
for x in dic:
    m = max(m, dic[x])
cnt += N - 1 - m
print(cnt)
import math
class Vertice:
  def __init__(self, num):
    self.num = num
    self.connected = []
    self.edge = []
    self.pos = math.inf
    
def DFS(vertice):
  judge = True
  for con in vertice.connected:
    index = vertice.connected.index(con)
    if con.pos == math.inf:
      con.pos = vertice.pos + vertice.edge[index]
      judge = DFS(con)
    elif con.pos != vertice.pos + vertice.edge[index]:
      judge = False
    if judge == False:
      break
  return judge


N, M = (int(_) for _ in input().split())
vertices = [Vertice(i) for i in range(N)]
L, R, D = ([None for i in range(M)] for j in range(3))
for i in range(M):
  L[i], R[i], D[i] = (int(_) for _ in input().split())
for i in range(M):
  if not vertices[R[i] - 1] in vertices[L[i] - 1].connected:
    vertices[L[i] - 1].connected.append(vertices[R[i] - 1])
    vertices[R[i] - 1].connected.append(vertices[L[i] - 1])
    vertices[L[i] - 1].edge.append(D[i])
    vertices[R[i] - 1].edge.append(-D[i])
judge = True
for i in range(N):
  if vertices[i].pos == math.inf:
    vertices[i].pos = 0
    judge = DFS(vertices[i])
    if judge == False:
      break
if judge:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000002)

def DFS(i, pos, connected, distances):
  if pos[i] == None:
    pos[i] = 0
  size = len(connected[i])
  for j in range(size):
    if pos[connected[i][j]] == None:
      pos[connected[i][j]] = pos[i] + distances[i][j]
      if DFS(connected[i][j], pos, connected, distances) == False:
        return False
    elif pos[connected[i][j]] != pos[i] + distances[i][j]:
      return False
  return True

N, M = map(int, input().split())
pos = [None for i in range(N + 1)]
connected = [[] for i in range(N + 1)]
distances = [[] for i in range(N + 1)]
for i in range(M):
  l, r, d = map(int, input().split())
  connected[l].append(r)
  distances[l].append(d)
  connected[r].append(l)
  distances[r].append(-d)
judge = True
for i in range(1, N + 1):
  if pos[i] == None:
    judge = DFS(i, pos, connected, distances)
    if judge == False:
      break
if judge:
  print('Yes')
else:
  print('No')
(r,c) [int(i) for i in input().split()]

table = []
for rc in range(r):
    table.append([int(i) for i in input().split()])

table.append([0 for _ in range(c + 1)])

for rc in range(r):
    row_total = 0
    for cc in range(c):
        table[r][cc] += table[rc][cc]
        row_total += table[rc][cc]

    table[rc].append(row_total)
    table[r][c] += row_total

for row in table:
    print(' '.join([str(column) for column in row]))

### FIXED CODE ###

(r,c) = [int(i) for i in input().split()]

table = []
for rc in range(r):
    table.append([int(i) for i in input().split()])

table.append([0 for _ in range(c + 1)])

for rc in range(r):
    row_total = 0
    for cc in range(c):
        table[r][cc] += table[rc][cc]
        row_total += table[rc][cc]

    table[rc].append(row_total)
    table[r][c] += row_total

for row in table:
    print(' '.join([str(column) for column in row]))
n=int(input())
a=list(map(int,input().split()))
m=max(a)
cnt=[0]*(m+1)
for i in range(m+1):
  cnt[i]=a.count(i)
ans=[0]*(m-1)
for j in range(m-1):
  ans[j]=cnt[j]+cnt[j+1]+cnt[j+2]
print(max(ans))

### FIXED CODE ###

import collections

n=int(input())
a=list(map(int,input().split()))
m=max(a)
cnt=collections.Counter(a)
if m==0:
  print(len(a))
else:
  ans=[0]*(m-1)
  for j in range(m-1):
    ans[j]=cnt[j]+cnt[j+1]+cnt[j+2]
  print(max(ans))