peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
r = [list(map(int,input().split())) for _ in range(n)]
for i in range(n):
  r[i] = [r[i][0] - r[i][1], r[i][0] + r[i][1]]
r.sort(key = lambda x:x[1])
#print(r)
cur = -1001001001
ans = 0
for i in range(n):
  if cur <= r[i][0]:
    ans += 1
    cur = r[i][1]
print(ans)
# Judge status: Accepted
S,W=map(int, input().split())
print('unsafe' if W>=S else 'safe')
# Judge status: Accepted
a, b, m = map(int, input().split())
A = [int(ae) for ae in input().split()]
B = [int(be) for be in input().split()]

amin = min(A)
bmin = min(B)
smin = amin + bmin

for i in range(m):
  x, y, c= map(int, input().split())
  th = smin + c
  apmin = A[x-1]
  if apmin > th:
    pass
  else:
    bpmin = B[y-1]
    spmin = apmin + bpmin -c
    if spmin < smin:
      smin = spmin
    else:
      pass
print(smin)
# Judge status: Accepted
Q,H,S,D = map(int,input().split())
a = min(8*Q,4*H,2*S,D)
N = int(input())
yen = (N//2)*a
b = min(4*Q,2*H,S)
yen += (N%2)*b
print(yen)
# Judge status: Accepted
# coding: utf-8
# Your code here!

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

ans=0

ans+=min(A,K)
K-=min(A,K)
K-=min(B,K)
ans-=min(K,C)

print(ans)
# Judge status: Accepted
N,M = (int(X) for X in input().split())
if N>=M: print(0)
else:
    P   = sorted(int(X) for X in input().split())
    Mov = sorted(P[X+1]-P[X] for X in range(0,M-1))
    if N==1: print(sum(Mov))
    else: print(sum(Mov[:1-N]))
# Judge status: Accepted
n, m, x, y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

c = max(a)+1
d = min(b)
e = 0

if c > d:
    print("War")
else:
    for i in range(c,d+1):
        if x < i and i <= y:
            print("No War")
            e = 1
            break
    if e == 0:
        print("War")
# Judge status: Accepted

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

num = 1
ans = 0
for i in range(N):
    if a[i] == num:
       num += 1
    else:
        ans += 1
if num == 1:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N,K = MI()
A = LI()

left = 0
right = max(A)  # 可能
while left + 1 < right:
    mid = (left + right)//2
    if sum((A[i]+mid-1)//mid - 1 for i in range(N)) <= K:
        right = mid
    else:
        left = mid
print(right)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
d = [int(i) for i in input().split()]

num = [i for i in range(10)]
tmp = []
for i in num:
    if not i in d:
        tmp.append(str(i))

tmp.sort()
#print(tmp)
#a = n // 10 #nの桁数
b = str(n)
ans = ''
for i in b:
    for j in tmp:
        if i <= j:
            ans += j
            break
print(ans)
# Judge status: Accepted
H,W = map(int,input().split())
if H == 1 or W == 1:
    ans = 1
elif H%2 == 0:
    ans = (H//2)*W
else:
    ans = (H//2)*W + (W+1)//2
print(ans)
# Judge status: Accepted
import math
s = int(input())
n = 1
ans = 0
while s - (n * 3) >= 0:
    val = s - n * 3
    bar = n - 1
    ans +=math.factorial(val + bar) // (math.factorial(val) * math.factorial(bar))
    n +=1
print(ans % (10 ** 9 + 7))
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[list(map(int,input().split())) for a in range(n)]
c=[list(map(int,input().split())) for b in range(m)]
print(a)
print(c)
dist=0
minnum=0
for indi,i in enumerate(a):
    dist=0
    min=10*14
    for indj,j in enumerate(c):
        dist+=abs(i[0]-j[0])
        dist+=abs(i[1]-j[1])
        if min>dist:
            min=dist
            minnum=indj
            print(dist)
        dist=0 
    print(minnum+1)
# Judge status: Accepted
N = int(input())
print('ABD') if N >= 1000 else print("ABC")
# Judge status: Wrong Answer
n,*a=map(int,open(0).read().split())
t,v=sum(a),[1]
if ~len([print(-1) for q in a if(v:=v+[min(2*(v[-1]-q),t:=t-q)])[-1]<0]):print(sum(v))
# Judge status: Accepted
a,b,c,k=map(int,input().split())
ans=0
if(a>=k):
  ans=k
  k=0
else:
  ans=a
  k=k-a
if(b>=k):
  k=0
else:
  k=k-b
ans=ans-k
print(ans)
# Judge status: Wrong Answer
M=2019;l,r=map(int,input().split());l%=M;r%=M
print(0 if l>r or r-l>671 else min(i*j%M for i in range(l,r) for j in range(i+1,r+1)))
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

x = int(input())
li = [1]
b = 2
if x == 0:
    print(0)
    sys.exit()
while True:
    if b == 100:
        break
    p = 2
    while True:
        d = b**p
        if d>=x:
            break
        li.append(d)
        p += 1
    b+=1
li.sort()
print(li[-1])
# Judge status: Accepted
def main():
    a, b, t = map(int, input().split())
    time = t/a
    ans = int(time) * b
    print(int(ans))
if __name__ == '__main__':
    main()
# Judge status: Accepted
N, K= map(int,input().split())
a = list(map(int,input().split()))
#a=A[:]
for _ in range(K):
  B=[0]*(N+1)
  for i in range(N):
    t = a[i]
    B[max(i-t,0)] +=1
    B[min(i+t+1,N)] -=1
  for i in range(N):
    B[i+1] += B[i]
  a=B[:N]        
  if min(a)==N:
    break
print(*a)
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

cnt_odd = sum([int((Ai % 2) == 1) for Ai in A])
cnt_evn = N - cnt_odd

ptn_evn = 1 << cnt_evn

tab_ncr = [1]
ncr_tmp = 1
for i in range(cnt_odd):
    ncr_tmp *= (cnt_odd - i)
    ncr_tmp //= (i + 1)
    tab_ncr.append(ncr_tmp)

ans = 0
# print("#", tab_ncr)

for i in range(cnt_odd + 1):
    if i % 2 != P: continue
    #
    ans += (ptn_evn * tab_ncr[i])

print(ans)
# Judge status: Accepted
import math

n, m = map(int, input().split())
if n==m:
    print((math.factorial(n)*math.factorial(m)*2)%1000000007)
elif abs(n-m)==1:
    print((math.factorial(n)*math.factorial(m))%1000000007)
else:
    print(0)
# Judge status: Wrong Answer
n = int(input())
print(1000 - (n % 1000))
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))

for i in range(min(50, k)):
    DP = [0] * (n+1)
    for j in range(n):
        light = A[j]
        DP[max(0, j-light)] += 1
        DP[min(n, j+light+1)] -= 1

    for j in range(1, n):
        DP[j] += DP[j-1]

    A = DP[:-1]

print(*A)
# Judge status: Accepted
w,h,n = map(int,input().split())
q = [[0],[w],[0],[h]]
for i in range(n):
    x,y,a = map(int,input().split())
    if a == 1 or a == 2:
        q[a-1].append(x)
    else:
        q[a-1].append(y)
if max(q[0]) >= min(q[1]) or max(q[2]) >= min(q[3]):
    print(0)
else:
    print((min(q[1])-max(q[0]))*(min(q[3])-max(q[2])))
# Judge status: Wrong Answer
import sys
import math
A,B=map(int,input().split())
if A<B:
  A,B=B,A
if B%A==0:
  print(A)
  sys.exit()
L=[]
for i in range(1,math.ceil(A/2)):
  if A%i==0 and B%i==0:
    L.append(i)
print((A*B)/L[-1])
# Judge status: Wrong Answer
# 043A
# N人の時のキャンディーの合計数
# 入力値 子供の人数


# 入力
n =int(input())

# 処理
answer = (n + 1) * n / 2

print(answer)
# Judge status: Accepted
S=input()
count=1
for i in range(3):
    if S[i] == S[i+1]:
        print('Bad')
        break
else:
    print('Good')
# Judge status: Wrong Answer
n=int(input())
xy=[list(map(int,input().split())) for i in range(n)]
d=[]
for i in range(n):
  d.append([xy[i][0]+xy[i][1],xy[i][0],xy[i][1]])
d.sort()
print(abs(d[0][1]-d[-1][1])+abs(d[0][2]-d[-1][2]))
# Judge status: Accepted
from itertools import accumulate
n=int(input())
w=list(map(int,input().split()))
tmp=0
l=list(accumulate(w))
ans=float("inf")
for i in range(n):
    tmp=abs(l[i]-(l[n-1]-l[i]))
    if tmp<ans:
        ans=tmp
print(ans)
# Judge status: Wrong Answer
n=int(input())
temp=100
ans=0
for i in range(n):
  s=list(map(int,input().split()))
  if temp==0:
    ans+=max(s[1], s[2])
    temp=s.index(max(s[1], s[2]))
  elif temp==1:
    ans+=max(s[0], s[2])
    temp=s.index(max(s[0], s[2]))
  elif temp==2:
    ans+=max(s[1], s[0])
    temp=s.index(max(s[1], s[0]))
  else:
    ans+=max(s)
    temp=s.index(max(s))
print(ans)
# Judge status: Accepted
A,B,C=map(int,input().split())
if A*C<=B :
  print(C)
else :
  print(B//A)
# Judge status: Accepted
k = int(input())

if k % 2 == 0:
    print(int((k/2)**2))
else:
    print((k//2) * (k//2+1))
# Judge status: Accepted
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
bc=[list(map(int,input().split())) for i in range(m)]
bc=sorted(bc,reverse=True,key=lambda x:x[1])
c=[]

cnt=0
for B,C in bc:
    for i in range(B):
        if cnt==n:break
        cnt+=1
        c.append(C)
c=sorted(c,reverse=True)

ans=sum(a)
temp=ans
for i in range(n):
    if cnt<=i:continue
    temp+=-a[i]+c[i]
    if temp>ans:ans=temp
print(ans)
# Judge status: Accepted
A = int(input())
S = input()
ans = S if A >= 3200 else 'red'
print(ans)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = input()
flag1, flag2 = False, False
if d > c:
    flag = "##" not in s[b: d] and "##" not in s[a: c]
else:
    flag = "..." in s[b: d]

print("Yes" if flag else "No")
# Judge status: Wrong Answer
a, b, k = map(int, input().split())

ans = []
for i in range(1, 100):
    if a % i == 0 and b % i == 0:
        ans.append(i)

print(ans[-k])
# Judge status: Accepted
A, B, C = map(int, input().split())

flag = False

for i in range(B + 1):
    if A * i % B == C:
        flag = True
        break

print('YES' if flag else 'NO')
# Judge status: Accepted
w, h, x, y = map(int, input().split())
print(w*h/2)
if 2*x == w and 2*y == h:
  print(1)
else:
  print(0)
# Judge status: Accepted
# coding: utf-8
import math
import sys

N = int(input())
Xi = list(map(int, input().split()))
Xi.sort()
min = Xi[0]
max = Xi[N-1]
tmp = 0
result = sys.maxsize
for i in range(min,max+1):
    for j in range(0,N):
        tmp += (Xi[j] - i)**2
    if tmp <= result:
        result = tmp
    tmp = 0

print(result)
# Judge status: Accepted
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ch = [10000]*n
for i in range(n):
    ch[i] = abs(a - (t - h[i]*6/1000))
print(ch.index(min(ch))+1)
# Judge status: Wrong Answer
n = int(input())
ans = 1
arr = input().split(" ")
x = True
for i in range(n):
  ans = ans*int(arr[i])
  if ans > 1000000000000000000:
    print(-1)
    x = False
if x:
  print(ans)
# Judge status: Accepted
N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N-1)]

ans = 0
memo = {}
memoset = set()
def dfs(i, time):
    if i==N-1:
        return time
    c, s, f = CSF[i]
    if time<s:
        time = s
    elif time%f!=0:
        time = (time//f+1)*f
    if (time, i) in memoset:
        return memo[(time, i)]
    T = dfs(i+1, time+c)
    memo[(time, i)] = T
    memoset.add((time, i))
    return T

for i in range(N-1):
    print(dfs(i, 0))
print(0)
# Judge status: Wrong Answer
n=int(input())
L=list(map(int,input().split()))
sum=0
max=0
for i in L:
    if i>max:
        sum+=max
        max=i
if max<sum:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def dcount(n):
    c = 0
    for i in range(1, n+1):
        if n % i == 0:
            c += 1
    return c

N = int(input())
c = 0
for i in range(1, N + 1, 2):
    if dcount(i) == 8:
        c += 1
print(c)
# Judge status: Wrong Answer
from collections import Counter

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

# 長さと個数の辞書
length_num = Counter(A)
# 長い順からの長さのリスト
lengths = sorted(list(length_num.keys()), reverse=True)

ans = 0
sides = []

# 長い辺の順にループ
for l in lengths:
  if len(sides) == 2:
    break
  if length_num[l] >= 4:
    ans = l * l
    break
  if length_num[l] >= 2:
    sides.append(l)

if len(sides) == 2:
  ans = sides[0] * sides[1]

print(ans)
# Judge status: Wrong Answer
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


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

    if N < B:
        x = N
        res = math.floor(A * x / B)
        return print(res)

    x = (N // B) * B - 1
    res = math.floor(A * x / B) - A * math.floor(x / B)
    return print(res)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N, M = map(int,input().split())
if N % 2 == 1:
	for i in range(1,1+M):
		print(i, 2*M+1-i)
elif N % 4 == 0:
	a = [2*i for i in range(1,N//4)] + [2*j + 1 for j in range(N//4, N//2)]
	for i in range(1, 1+M):
		print(i, i+a[-i])
else:
	a = [2*i for i in range(1,N//4+1)] + [2*j + 1 for j in range(N//4+1, N//2)]
	for i in range(1, 1+M):
		print(i, i+a[-i])
# Judge status: Accepted
#ABC 049 C
S = input()
T = ''
S = S[::-1]
words = ["dream","dreamer","erase","eraser"]
rev_words = [w[::-1] for w in words]

flag = False
i=0
while(1):
	for w in rev_words:
		s = S[i:i+len(w)]
		if s == w:
			flag = True
			T += w
			i += len(w)
			break
	if T == S:
		ans = "YES"
		break
	if flag == False:
		ans = 'NO'
		break
	flag = False

print(ans)
# Judge status: Wrong Answer
N = int( input() )
x = int( 800 * N )

#  １５食食べるごとに２００円もらえる

y = int( 200 * N / 15 )

print( x - y )
# Judge status: Accepted
N = int(input())
ans = []

def digitSum(num):
    s = str(num)
    array = list(map(int,s))
    return sum(array)

for A in range(1,N):
    B = N-A
    ans.append(digitSum(A)+digitSum(B))
print(min(ans))
# Judge status: Accepted
S = input()
N = len(S)

L = abs(S.count('0') - S.count('1'))

print(N - L)
# Judge status: Wrong Answer
N=int(input())
for i in range(7):
  x=2**i
  if x<=N:
      max=2**i
print(x)
# Judge status: Accepted
import math
n = int(input())
a = list(map(int,input().split()))
avg = sum(a)/n
x = math.floor(avg)
y = math.ceil(avg)
sumx = 0
sumy = 0
for i in a:
    sumx += (i - x) ** 2
    sumy += (i - y) ** 2

print(min([sumx,sumy]))
# Judge status: Accepted
d, t, s = map(int, input().split())
if d/s <= t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
ans = 10**9
for i in range(-100,101):
  tmp = 0
  for a in A:
    tmp += (a-i)**2
  ans = min(ans, tmp)
print(ans)
# Judge status: Wrong Answer
N = input()
TA = input().split()
T = int(TA[0])
A = int(TA[1])

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A * 1000 - T - H[i] * 0.006 * 1000)
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i
        minTmep = compare

print(place + 1)
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())
S = input()

if "##" in S[A:C] or "##" in S[B:D]:
  print("No")
  exit()

if D - C < 0:
  if "..." not in S[B-2:D+1]:
    print("No")
    exit()
    
print("Yes")
# Judge status: Accepted
A, B, C = [int(x) for x in input().split()]
print(min(C, B // A))
# Judge status: Wrong Answer
n,m,x = map(int, input().split())
result = 10**9
A=[]
C=[]
for _ in range(n):
	books=list(map(int, input().split()))
	C.append(books[0])
	A.append(books[1:])
for i in range(1<<n):
	cnt = 0
	rikaido = [0]*m
	for j in range(n):
		if (i>>j)&1:
			for k in range(m):
				rikaido[k]+=A[j][k]
			cnt += C[j]
		else:
			pass
	if min(rikaido)>=x:
		result = min(result, cnt)
if result == 10*9:
	print(-1)
else:
	print(result)
# Judge status: Accepted
arb = 'abcdefghijklmnopqrstuvwxyz'
S = input()

ans =''
for i in arb:
    if i not in S:
        ans += i

sort_ans = sorted(ans)
if len(ans)==0:
    print('None')
else:
    print(sort_ans[0])
# Judge status: Wrong Answer
N=int(input())
mod=10**9+7

ans1=1
ans2=1
ans3=1
ans4=1
ans=0
for x in range(1,N):
    for y in range(1,N):
        ans1*=(N-(x-1))
        ans1%=mod
        ans2*=x
        ans2%=mod
        ans3*=(N-x-(y-1))
        ans3%=mod
        ans4*=y
        ans4%=mod
        ans5=8**(N-(x+y))
        ans5%=mod
        ans+=ans1*ans3*ans5/(ans2*ans4)
        ans%=mod
print(ans)
# Judge status: Accepted
n=int(input())
if n%2==1:
  print(0)
else:
  n//=2
  c=0
  x=5
  while x<=n:
    c+=n//x
    x*=5
  print(c)
# Judge status: Wrong Answer
a,b,c,k = map(int, input().split())

ans = a - b

if(k % 2 == 1):
    ans = abs(ans)

if(len(str(ans)) >= 18):
    ans = 'Unfair'

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
def main():
    X, K, D = map(int, input().split())

    res = abs(X) // D
    if res <= K:
        K -= res
        if K % 2:
            print(abs(abs(X) % D - D))
        else:
            print(abs(X) % D)
    else:
        print(abs(X) - D * K)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
B = [0]*N
res = 0
B[N-1] = A[N-1]
for i in range(1, N):
    B[N-i-1] = B[N-i] + A[N-i-1]
for i in range(N-1):
    res = (res + A[i] * B[i+1]) % (10**9+7)
print(res)
# Judge status: Accepted
from math import gcd
a, b = map(int,input().split())
 
print(int(a * b / gcd(a, b)))
# Judge status: Wrong Answer

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 0
  tempmin = 10000000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if (min >= tempmin):
      break
    tempmin = min

  print(min)
# Judge status: Accepted
n,m =  map(int,input().split())
if n==1 or m == 1:
    if n==1 and m==1:
        ans = 1
    else:
        ans = n*m - 2
else:
    ans = (n-2)*(m-2)
print(ans)
# Judge status: Wrong Answer
h = list(map(int, input().split()))

if h[1] > h[3]:
    print((h[2]-h[0])*60+h[3]-h[1]-h[4])
else:
    print((h[2]-h[0]-1)*60+60-h[3]+h[1]-h[4])
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0

for c in range(k, n+2):
	ans = (ans + (c * (n-c+1) + 1)) % (10**9+7)

print(ans % (10**9+7))
# Judge status: Accepted
a,b,x = map(int,input().split())
ad = (a-1)//x
bd = b//x
print(bd-ad)
# Judge status: Wrong Answer
#ABC 079 C
a,b,c,d=list(input())
s="+-"

for i in range(2):
    for j in range(2):
        for k in range(2):
            if a+s[i]+b+s[j]+c+s[k]+d==7:
                print(eval(a+s[i]+b+s[j]+c+s[k]+d))
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
s = [input().split() for i in range(n)]
points = [int(pt) for k, pt in s]

dicts = {key:[] for key in sorted(list(set([k for k, v in s])))}
for area, pt in s:
  dicts[area].append(int(pt))

for area, pts in dicts.items():
  for pt in sorted(pts)[::-1]:
    print(points.index(pt)+1)
# Judge status: Wrong Answer
import math
N = int(input())
print(0)
print(0)
for i in range(3, N+1):
    ra = math.sqrt(i - 2) - 1
    ran = math.floor(ra)
    ans = 0
    for x in range(1, ran+1):
        for y in range(1, ran+1):
            for z in range(1, ran+1):
                f = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if i == f:
                    ans += 1
    print(ans)
# Judge status: Accepted
import itertools
N, M, Q = map(int, input().split())
abcd = list()
for i in range(Q):
    a,b,c,d = map(int, input().split())
    abcd.append((a,b,c,d))
iters = itertools.combinations_with_replacement(range(1, M+1), N)
ans = 0
for com in iters:
    sum = 0
    for a,b,c,d in abcd:
        if(com[b-1]-com[a-1] == c):
            sum += d
    if(sum > ans):
        ans = sum
print(ans)
# Judge status: Accepted
S = list(input())
s = set(S)
if len(s)!=1:
    print('Yes')
else:print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)

ans = a[0]
n -= 2
now = 1
while n > 0:
    if n >= 2:
        ans += a[now]*2
        now += 1
        n -= 2
    elif n == 1:
        ans += a[now]
        n -= 1
        now += 1
print(ans)
# Judge status: Accepted

def solve(K):
    a = 7 % K
    for i in range(1, K+1):
        if a == 0:
            return i
        a = (a * 10 + 7) % K
    return -1 

        

def solve0(K):
    a = 7
    for i in range(0, 10000):
        if a % K == 0:
            return i
        a = a*10+7
    return -1

K = int(input())
print(solve(K))
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N > M:
    N, M = M, N

if N == 1:
    M -= 2
else:
    N -= 2
    M -= 2

print(N * M)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if k > (b-a) and k > (c-b) and k > (d-c) and k > (e-d) :
    print("Yay!")
else :
    print(":(")
# Judge status: Accepted
N,M=map(int,input().split())
print('Yes' if N==M else 'No')
# Judge status: Accepted
N, K = map(int, input().split())
MOD = 1000000007

min_ = sum([i for i in range(K)])
max_ = sum([i for i in range(N, N - K, -1)])

right = K - 1
left = N - (K - 1)

cnt = 0
for k in range(K, N + 2):
    cnt += max_ - min_ + 1

    right += 1
    left -= 1

    min_ += right
    max_ += left

print(cnt % MOD)
# Judge status: Accepted
n, a, b = map(int,input().split())
num = b - a + 1

ans = b*(n-2) - a*(n-2) + 1 if b >= a else 0
print(ans if ans >= 0 else 0)
# Judge status: Accepted
#n = int(input())
n, q = map(int, input().split())
#bl = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]
s = input()
acnum = [0]*(n+1)
for i in range(2, n+1):
    if s[i-2:i] == 'AC':
        acnum[i] += acnum[i-1]+1
    else:
        acnum[i] += acnum[i-1]

for i in range(q):
    l, r = map(int, input().split())
    print(acnum[r]-acnum[l])
# Judge status: Accepted
A = int(input())
B = int(input())
l=[1,2,3]
l.remove(A)
l.remove(B)
print(l[0])
# Judge status: Accepted
N,M=map(int,input().split())

a,b=1,N//2
c,d=N//2+1,N
if N%2==0:
    a+=1
i=0
while i<M:
    if i<M:
        print(c,d)
        i+=1        
        c,d=c+1,d-1
    else:
        break
    if i<M:
        print(a,b)
        a,b=a+1,b-1
        i+=1
    else:
        break
# Judge status: Accepted
s,t = input().split()
a,b = (int(x) for x in input().split())
u = input()
if s == u:
	a-=1
else:
	b-=1
print(a,b)
# Judge status: Wrong Answer
n = int(input())
P = list(map(int, input().split()))

cnt = [0]*n
for i in range(n):
    if P[i] == i+1:
        cnt[i] += 1

if cnt.count(1) == 0:
    print(0)
else:
    ans, i = 0, 0
    while i < n-1:
        if cnt[i] == 1:
            if cnt[i+1] == 1:
                ans += 1
                i += 1
        i += 1
    if cnt[-1] == 1:
        ans += 1

    print(ans)
# Judge status: Accepted
from itertools import combinations 

N = int(input())
L_list = list(map(int, input().split()))
ans = 0

for x, y, z in combinations(L_list, 3):
  #print(x, y, z)
  if x == y or y == z or z == x:
    continue
  if x + y > z and y + z > x and z + x > y:
    ans += 1

print(ans)
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    N = int(input())

    memo = [0 for _ in range(N+1)]
    memo[:2] = [2, 1]

    for i in range(2, N+1):
        memo[i] = memo[i-1] + memo[i-2]

    print(memo[N])

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
n,k=map(int,input().split())
d = list(map(int,input().split()))
#print(d)
for i in range(n,10**5):
    count=0
    for j in range(k):
        u = str(d[j])
        if(str(i).count(u)==0):
            count+=1
    #print("count:"+str(count))
    if(count==k):
        print(i)
        break
# Judge status: Accepted
n, x, t =map(int, input().split())
k = (n + x - 1) // x
ans = k * t
print(ans)
# Judge status: Accepted
sum = 0
for i in range(1,int(input())+1):
    sum += i
print(sum)
# Judge status: Accepted
n = int(input())

answer = 0
for i in range(1,n+1):
  if len(str(i))%2 == 1:
    answer += 1
      
print(answer)
# Judge status: Accepted
# -*- coding: utf-8 -*-

H1, M1, H2, M2, K = map(int, input().split())

print(max((H2*60+M2) - (H1*60+M1) - K, 0))
# Judge status: Accepted
n,p=map(int, input().split())
A=[int(i)%2 for i in input().split()]
t=sum(A)

if t==0:
    if p==1:
        print(0)
    else:
        print(2**n)
else:
    print(2**(n-1))
# Judge status: Wrong Answer
a = input()
if a.isupper():
    print(a.lower())
else:
    print(a)
# Judge status: Accepted
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]

card_min = 0
card_max = N
ans = N
#print(card_min, card_max)
for l, r in LR:
    if l > card_min:
        card_min = l
    if r < card_max:
        card_max = r
    #print(card_min, card_max)
    ans = card_max - card_min + 1
    if ans <= 0:
        ans = 0
        break
print(ans)
# Judge status: Wrong Answer
N,L = map(int,input().split())
c = 0
if L >= 0:
    skip = 0
else:
    if N - (-L) >= 0:
        skip = L*-1
    else:
        skip = N-1
for i in range(N):
    if i == skip:
        continue
    c += L+i
print(c)