Harryxun/stf_run huggingface dataset:
import sys
def cal(sgn, n1, n2):
    return n1 + n2 if sgn == '+' else n1 - n2


A, B, C, D = map(int, list(input()))
sgns = []
for bit in range(1<<3):
    tmp = ['+'] * 3
    for i in range(3):
        if ((bit>>i) & 1) == 1:
            tmp[i] = '-'
    sgns.append(tmp)

for sgn in sgns:
    if cal(sgn[2], cal(sgn[1], cal(sgn[0], A, B), C), D) == 7:
        print(f'{A}{sgn[0]}{B}{sgn[1]}{C}{sgn[2]}{D}=7')
        sys.exit()

### FIXED CODE ###

def cal(sgn, n1, n2):
    return n1 + n2 if sgn == '+' else n1 - n2


A, B, C, D = map(int, list(input()))
sgns = []
for bit in range(1<<3):
    tmp = ['+'] * 3
    for i in range(3):
        if ((bit>>i) & 1) == 1:
            tmp[i] = '-'
    sgns.append(tmp)

for sgn in sgns:
    if cal(sgn[2], cal(sgn[1], cal(sgn[0], A, B), C), D) == 7:
        print('{0}{1}{2}{3}{4}{5}{6}=7'.format(A, sgn[0], B, sgn[1], C, sgn[2], D))
        exit()
N = int(input())
A = []
from collections import defaultdict as ddict
for n in range(N):
  A.append(int(input()))

B = ddict(int)
for a in A:
  B[a] += 1
for n in range(N):
  print(B[n])

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
from collections import defaultdict as ddict

B = ddict(int)
for a in A:
  B[a-1] += 1
for n in range(N):
  print(B[n])
N = input()
if N == 1:
  print("Hello World")
else:
  A = input()
  B = input()
  print(int(A+B))


### FIXED CODE ###

if int(input()) == 1:
    print("Hello World")

else:
    A = int(input())
    B = int(input())
    print(A + B)
a,v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if(w>=v):
  print("NO")
else if(abs(b-a)/(v-w) > t):
  print("NO")
else:
  print("YES")


### FIXED CODE ###

a,v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
 
if(w>=v):
  print("NO")
elif(abs(b-a)/(v-w) > t):
  print("NO")
else:
  print("YES")
import sys
input = sys.stdin.readline
from collections import *
from math import gcd

N = int(input())
cnt = defaultdict(int)
abzero = 0
azero = 0
bzero = 0

for _ in range(N):
    A, B = map(int, input().split())
    
    if A==0 and B==0:
        abzero += 1
    elif A==0:
        azero += 1
    elif B==0:
        bzero += 1
        
    G = gcd(abs(A), abs(B))
    A //= G
    B //= G
    
    if (A<0 and B>0) or (A<0 and B<0):
        A *= -1
        B *= -1
    
    cnt[(A, B)] += 1

ans = 1
MOD = 10**9+7
visited = set()

for k in cnt.keys():
    if k in visited:
        continue
    
    if k[0]>0 and k[1]>0:
        k2 = (k[1], -k[0])
    else:
        k2 = (-k[1], k[0])
    
    if k2 not in cnt:
        ans *= pow(2, cnt[k], MOD)
    else:
        ans *= pow(2, cnt[k], MOD)+pow(2, cnt[k2], MOD)-1
        visited.add(k2)

ans *= pow(2, azero, MOD)+pow(2, bzero, MOD)-1
ans %= MOD
ans += abzero-1
ans %= MOD
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import *

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

N = int(input())
zero1 = 0
zero2 = 0
zero3 = 0
cnt = defaultdict(int)
MOD = 10**9+7

for _ in range(N):
    A, B = map(int, input().split())
    
    if A==0 and B==0:
        zero1 += 1
    elif A>0 and B>0:
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(A, B)] += 1
    elif A>0 and B<0:
        B *= -1
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(-A, B)] += 1
    elif A<0 and B>0:
        A *= -1
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(-A, B)] += 1
    elif A<0 and B<0:
        A *= -1
        B *= -1
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(A, B)] += 1
    elif A==0:
        zero2 += 1
    elif B==0:
        zero3 += 1

s = set()
ans = 1

for k in cnt.keys():
    if k in s:
        continue
    
    k2 = (-k[1], k[0])
    
    if k2[0]<0 and k2[1]<0:
        k2 = (-k2[0], -k2[1])
        
    a = cnt[k]
    
    if k2 not in cnt:
        ans *= pow(2, a, MOD)
        ans %= MOD
    else:
        b = cnt[k2]
        ans *= pow(2, a, MOD)+pow(2, b, MOD)-1
        ans %= MOD
        s.add(k2)

ans *= pow(2, zero2, MOD)+pow(2, zero3, MOD)-1
ans += zero1
ans %= MOD
ans -= 1
ans %= MOD

print(ans)
a = list(input())
b = list(input())
n = 0
for c, d in zip(a, b):
  if c != d:
    count += 1

### FIXED CODE ###

a = list(input())
b = list(input())
n = 0
for c, d in zip(a, b):
  if c != d:
    n += 1
print(n)
from math import *
while True:
    n = int(raw_input())
    if n == 0:
        break
    for i in range(n):
        sco = map(int,raw_input().split())
        ave=0.0
        for i in sco:
            ave += i
        ave /= n

        dev = 0.0
        for i in sco:
            dev += (i-ave)*(i-ave)
        dev /= n

        print sqrt(dev)

### FIXED CODE ###

from math import *
while True:
    n = 0
    n = int(input())
    if n == 0:
        break
    else :
        sco = map(int,raw_input().split())
        for i in range(n):
            ave=0.0
            for i in sco:
                ave += i
            ave /= n
            dev = 0.0
            for i in sco:
                dev += (i-ave)*(i-ave)
            dev /= n
        print sqrt(dev)
import sys
n , m, *e = map(int,sys.stdin.read().split())
total = n*(n-1)//2
ans =[total]
u = [-1]*(n+1)

def find(x):
    if u[x] < 0 :
        return x
    else:
        return find(u[x])

for x , y in zip(e[-2:1:-2],e[:1:-2]):
    x = find(x)
    y = find(y)
    if x != y:
        total -= u[x] * u[y]
        u[x] += u[y]
        u[y] = x　　
    ans += [total]
    print(u)

print(*ans[::-1], sep="\n")

### FIXED CODE ###

import sys
n , m, *e = map(int,sys.stdin.read().split())
total = n*(n-1)//2
ans =[total]
u = [-1]*(n+1)

def find(x):
    if u[x] < 0 :
        return x
    else:
        return find(u[x])

for x , y in zip(e[-2:1:-2],e[:1:-2]):
    x = find(x)
    y = find(y)
    x, y = sorted((x, y))
    if x != y:
        total -= u[x] * u[y]
        u[x] += u[y]
        u[y] = x
    ans += [total]

print(*ans[::-1], sep="\n")
s = input()
for i in range(len()s):
  if i % 2 == 0 && s[i] == "R":
    print("No")
    exit()
  elif i % 2 == 1 && s[i] == "L":
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

s = input()
for i in range(len(s)):
  if i % 2 == 0 and s[i] == "L":
    print("No")
    exit()
  elif i % 2 == 1 and s[i] == "R":
    print("No")
    exit()
print("Yes")
import math
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
if k>max(a):
    print("IMPOSSIBLE")
    exit()
g=a[0]
for i in range(1,n):
    g=math.gcd(g,a[i])
for i in range(n):
    a[i]=a[i]%g
if k%g in a:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

import fractions
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
b=[0]*n
if k>max(a):
    print("IMPOSSIBLE")
    exit()
g=a[0]
for i in range(1,n):
    g=fractions.gcd(g,a[i])
for i in range(n):
    b[i]=a[i]%g
if k%g in b:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
R=int(input()), G=int(input())
P=2G-R
print(P)

### FIXED CODE ###

R=int(input())
G=int(input())
P = 2*G-R
print(P)
x = list(5)
for i in range(5) : x[i] = int(input())
x.sort()
k = int(input())
if x[4] - x[0] <= k : print("Yay!")
else : print(":(")

### FIXED CODE ###

x = [0] * 5
for i in range(5) : x[i] = int(input())
x.sort()
k = int(input())
if x[4] - x[0] <= k : print("Yay!")
else : print(":(")
a, b, x = map(int, input().split())
print((b-a)//x+((a%x==0)or(b%x==0))

### FIXED CODE ###

a, b, x = map(int, input().split())
print(b//x-(a-1)//x)
a,b = list(map(int,input().split()))
if b%a = 0:
  print(a+b)
else:
  print(a-b)

### FIXED CODE ###

a,b = list(map(int,input().split()))
if b%a == 0:
  print(a+b)
else:
  print(b-a)
import sys
read = lambda: sys.stdin.readline().rstrip()
 
def main():
    INF = 10 ** 20

    n,k = map(int,input().split())
    h = tuple(map(int,read().split()))
    dp = [INF]*(n+1)
    dp[0] = 0

    for step in range(1, k+1):
        for i in range(step,n):
            dp[i] = min(dp[i], dp[i-step]+abs(h[i]-h[i-step]))

    print(dp[n-1])
if __name__ == "__main__":
    main()

### FIXED CODE ###

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

INF = 10 ** 20

dp = [INF]*(n)
dp[0] = 0
dp[1] = abs(h[1]-h[0])
 
for i in range(2,n):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
 
print(dp[n-1])
n, k= input().split()
l = list(map(int,input().split()))
checkNum=[i for i in range(11)]

def find(x):
    while x!=checkNum[x]:
        checkNum[x]=checkNum[checkNum[x]]
        x=checkNum[x]
    return x

for i in l:
    checkNum[find(i)]=checkNum[find(i+1)]

fin=""
for i in range(len(n)):
    first=int(n[i])
    k=find(first)
    if k==first:
        fin+=str(k)
    else:
        if k!=10:
            fin+=str(k)
            i+=1
        else:fin+=str(find(1))
        fin+=str(find(0))*(len(n)-i)
        break

p

### FIXED CODE ###

n, k= input().split()
l = list(map(int,input().split()))
checkNum=[i for i in range(11)]

def find(x):
    while x!=checkNum[x]:
        checkNum[x]=checkNum[checkNum[x]]
        x=checkNum[x]
    return x

for i in l:
    checkNum[find(i)]=checkNum[find(i+1)]

fin=""
for i in range(len(n)):
    first=int(n[i])
    k=find(first)
    if k==first:
        fin+=str(k)
    else:
        if k!=10:
            fin=str(k)+str(find(0))*(len(n)-i-1)
        else:
            fin=str(find(1))+str(find(0))*len(n)
        break

print(fin)
x,y = map(int,input().split())
for i in range (0,x+1):
    if y==2*i+4*(x-i):
        print(Yes)
    else:
        if i==x:
            print(No)

### FIXED CODE ###

x,y = map(int,input().split())
ans='No'
for i in range(x+1):
    if y == 2*i+4*(x-i):
        ans='Yes'
print(ans)
import math

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

#keyはA[i]、valueは登場回数
A_unique = {}
 
for i in range(0,len(A)):
    if A[i] in A_unique:
        A_unique[A[i]] += 1
    else:
        A_unique[A[i]] = 1
v = list(A_unique.values())
v.sort() #登場回数が少ない順に書き換えていく
A_length = len(A_unique.keys()) #元々のAの長さ
d = 0

for k in v:
    if  A_length - d < K:
        print(d)
        break
    else:
        d += A_unique[k] 


### FIXED CODE ###

s = input()
num = list(map(int, str(s)))
print(num.count(1))
N = int(input())
H = list(map(int, input().split()))
for i in range(1, N):
    M = max(M, H[i - 1])
    if H[i] < M - 1:
        print("No")
        exit()
print("Yes")


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
M = 0
for i in range(1, N):
    M = max(M, H[i - 1])
    if H[i] < M - 1:
        print("No")
        exit()
print("Yes")
n,m=map(int,input().split())

ans_ac = set()
wa_cnt = 0
wa_sled = [i for i in range(1,n+1)]


for i in range(m):
  p,s = input().split()
  if s == "AC":
    ans_ac.add(p)
    wa_sled.remove(int(p))
    if len(wa_sled) == 0:
      break
      
  if s == 'WA' and p not in wa_sled:
    wa_cnt += 1
    
print(len(ans_ac),wa_cnt)

### FIXED CODE ###

n,m=map(int,input().split())
ac_cnt = set()
wa_cnt = 0
penalty = [0]*n
for i in range(m):
    p,s = input().split()
    num = int(p) - 1
    if num not in ac_cnt:
        if s == "AC":
            ac_cnt.add(num)
            wa_cnt += penalty[num]
        else:
            penalty[num] += 1
print(len(set(ac_cnt)),wa_cnt)
yyyy = int(input())
mm = int(input())
dd = int(input())
if yyyy < 2019:
    print('Heisei')
elif yyyy > 2019:
    print('TBD')
else:
    if mm == 1 or mm == 2 or mm == 3 or mm == 4:
        print('Heisei')
    else:
        print('TBD')

### FIXED CODE ###

S = input()
if S <= '2019/04/30' :
    print('Heisei' )
else:
    print('TBD')
a, b, n = map(int, input().split())
if b == 1:
	print(0)
else:
	x = min(b-1, n)
	print(floor(a*x/b) - a * floor(x/b))

### FIXED CODE ###

from math import floor
a, b, n = map(int, input().split())
if b == 1:
	print(0)
else:
	x = min(b-1, n)
	print(floor(a*x/b) - a * floor(x/b))
import numpy as np

n = int(input())
a = np.array(input().split(), dtype=np.int)

if n % 2 == 0:
  print(max(a[::2].sum(), a[1::2].sum()))
else:
  dp = a[:3]
  for i in range(1, n // 2):
    dp = dp[0] + a[2*i], dp[:2].max() + a[2*i+1], dp.max() + a[2*i+2]
  print(dp.max())

### FIXED CODE ###

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

if n % 2 == 0:
  dp = a[:2]
  for i in range(1, n // 2):
    dp = dp[0] + a[2*i], max(dp) + a[2*i+1]
else:
  dp = a[:3]
  for i in range(1, n // 2):
    dp = dp[0] + a[2*i], max(dp[:2]) + a[2*i+1], max(dp) + a[2*i+2]

print(max(dp))
A=int(input())
X=int(input())

if X < A:
    print('0')
else:
    print('10')

### FIXED CODE ###

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

if X<A:
    print(0)
else:
    print(10)
import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 1)
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 1):
  ans[i] = solve(i, 0)
  
Us[0] = 1 % u
Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i-1] * 2) % u
  Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(X <= 2 * 10 ** 5 + 1):
    if(x[i] == '0'):
      print(solve2(X + 2 ** (n - i - 1), u))
    else:
      print(solve2(X - 2 ** (n - i - 1), d))
  else:
    if(x[i] == '0'):
      print(solve2(X + Us[n-i-1], u))
    else:
      print(solve2(X - Ds[n-i-1], d))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (n == 1 and x == '1'):
  print(0)
  exit()

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 4)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
if(d != 0):
  _d = (2 * 10 ** 5) // d
  D = X % d + (d * _d) * 2 + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 4):
  ans[i] = solve(i, 0)
Us[0] = 1 % u
if(d != 0):
  Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i - 1] * 2) % u
  if(d != 0):
    Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(x[i] == '0'):
    print(solve2(U + Us[n-i-1], u))
  else:
    if (d == 0):
      print(0)
    else:
      print(solve2(D - Ds[n-i-1], d))
x = []
for i in range(3):
    x.append(list(map(int,input().split())))
one,two,three,four = 0,0,0,0
def push(a):
    global one,two,three,four
    if a == 1:
        one = one + 1
    elif a ==2:
        two += 1
    elif a == 3:
        three += 1
    else :
        four +=1
for i in x:
    push(i[0])
    push(i[1])
if one*two*three*four ==0 or one ==3 or two ==3 or three ==3 or four ==3:
    print("NO")
else :
    print("YES")
    

### FIXED CODE ###

N,K = map(int ,input().split())
if N%2 == 0:
    if N/2 >= K:
        print("YES")
    else:
        print("NO")
else:
    if (N+1)/2 >= K:
        print("YES")
    else:
        print("NO")
a =input().split()
b =input().split()
count=0
for i in range(a):
  if a[i] ==b[i]:
    count =+1
print(count)

### FIXED CODE ###

a =list(input())
b =list(input())
count=0
for i in range(len(a)):
  if a[i] ==b[i]:
    count +=1
print(count)
a,b=map(int,input().split(" ")
if a>b:
	print("safe")
else:
    print("unsafe")
    


### FIXED CODE ###

a,b=map(int,input().split(" "))
if a>b:
    print("safe")
else:
    print("unsafe")
# -*- coding:utf8 -*-

n = int(input())
h = list(map(int, input().split()))
ans = 'Yes'
p, pp = 0, 0
for i in h:
    if p == 0:
        p = i
    d =  p - i
    if d < -1 or (d == -1 and pp == -1):
        ans  'No'
        break
    else:
        pp = p
        p = d
print(ans)

### FIXED CODE ###

# -*- coding:utf8 -*-

n = int(input())
h = list(map(int, input().split()))
p = h[0]
l = [p]
for i in range(1,n):
    c = h[i]
    if i == 1 and p - 1 == c:
        l[0] == c
    if p < c:
        c -= 1
    l.append(c)
    p = c
ans = 'Yes' if l == sorted(l) else 'No'
print(ans)
s1 = input()
s2 = input()

x, y, z = [int(i) for i in s1.split()]
l = [int(i) for i in s2.split()]
 
if x = 1:
  print(abs(z - l[x-1]))
else:
  if abs(z - l[x-1]) > abs(l[x-1] - l[x-2]):
    print(abs(z - l[x-1]))
  else:
    print(abs(l[x-1] - l[x-2]))

### FIXED CODE ###

s = input()

a, b = s.split()
if a.isdigit():
  a = int(a)
else:
  a = ord(a) - 50

if b.isdigit():
  b = int(b)
else:
  b = ord(b) - 50

if a < b:
  print("<")
elif a > b:
  print(">")
else:
  print("=")
from networkx import*
n, m = map(int, input().split())
edges = [tuple(map(int, input().split())) for _ in range(m)]
G = Graph()
#G.add_nodes_from(range(1, n+1))
G.add_edges_from(edges)
ccs = connected_components(G)
ans = max(map(len, ccs))
print(ans)

### FIXED CODE ###

from networkx import*
_,*t=map(str.split,open(0))
print(max(1,1,*map(len,connected_components(Graph(t)))))
import math
from collections import Counter
n=math.factorial(int(input()))
dp=[]
for i in range(2,int(math.sqrt(n))+2):
  while n%i==0:
    n//=i
    dp.append(i)
c=list(Counter(dp).items())
ans=1
#print(c)
for j in range(len(c)):
  ans*=c[j][1]+1
print(ans%1000000007)

### FIXED CODE ###

import math
from collections import Counter
n=math.factorial(int(input()))
dp=[]
for i in range(2,1001):
  while n%i==0:
    n//=i
    dp.append(i)
c=list(Counter(dp).items())
ans=1
for j in range(len(c)):
  ans*=c[j][1]+1
print(ans%1000000007)
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(1000000000)

N, *XY = map(int,open(0).read().split())
MOD = 10**9 + 7

neighbor = [[] for _ in range(N)]
for x,y in zip(*[iter(XY)]*2):
    neighbor[x-1] += y-1,
    neighbor[y-1] += x-1

parent = {0}

def dp(node):
    black_output = white_output = 1
    for child in neighbor[node]:
        if child in parent:
            continue
        else:
            parent.add(child)
            tmp_black, tmp_white = dp(child)
            black_output *= tmp_white
            white_output *= tmp_black + tmp_white
    black_output %= MOD
    white_output %= MOD
    return black_output, white_output

print(sum(dp(0)) % MOD)

### FIXED CODE ###

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

N, *XY = map(int,open(0).read().split())
MOD = 10**9 + 7

neighbor = [[] for _ in range(N)]
for x,y in zip(*[iter(XY)]*2):
    neighbor[x-1] += y-1,
    neighbor[y-1] += x-1,

parent = {0}

def dp(node):
    black_output = white_output = 1
    for child in neighbor[node]:
        if child in parent:
            continue
        else:
            parent.add(child)
            tmp_black, tmp_white = dp(child)
            black_output *= tmp_white
            white_output *= tmp_black + tmp_white
    black_output %= MOD
    white_output %= MOD
    return black_output, white_output

print(sum(dp(0)) % MOD)
#coding:utf-8
n=[int(i) for i in input().split()]
Ad=0
Au=0
A=[int(i) for i in input().split()]
for i in range(n[1]):
  if(A[i]>n[3]):
    Au+=1
  else:
    Ad+=1
if(Au>=Ad):
  print(Ad)
else:
  print(Au)
  

### FIXED CODE ###

#coding:utf-8
n=[int(i) for i in input().split()]
Ad=0
Au=0
A=[int(i) for i in input().split()]
for i in range(n[1]):
  if(A[i]>n[2]):
    Au+=1
  else:
    Ad+=1
if(Au>=Ad):
  print(Ad)
else:
  print(Au)
class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]


n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
uf = UnionFind(n)
for i in a:
    uf.union(i[0],i[1])

print(len(list(set(uf.par))))

### FIXED CODE ###

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]


n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
uf = UnionFind(n)
b = []
for i in a:
    uf.union(i[0]-1,i[1]-1)
for i in range(n):
  b.append(uf.find(i))
print(len(list(set(b))))
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print(f'{no_ac} {no_wa}')

### FIXED CODE ###

n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = 0
no_wa = 0

for i in range(n):
    if ac[i] == 1:
        no_ac += 1
        no_wa += wa[i]

print(str(no_ac) + ' ' + str(no_wa))
n, m = map(int, input().split())
dp = [-1] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    a.append(aa)
    dp[aa - 1] = 0
mod = 10 ** 9 + 7

dp[0] = 1
if a[0] != 1:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])

### FIXED CODE ###

n, m = map(int, input().split())
dp = [0] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = -1
    a.append(aa)
for i in range(m - 1):
    if a[i] + 1 == a[i + 1]:
        print(0)
        exit()
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])