Harryxun/stf_run huggingface dataset:
# coding: utf-8
# Your code here!
import numpy as np
 
N, K = map(int, input().rstrip().split(' '))
X = np.array(list(map(int, input().rstrip().split(' '))))

min_cost = int(1e10)
for i in range(K, N+1):
    min_cost = min(min_cost, X[i-1] - X[i-K] + min(abs(X[i-1]), abs(X[i-K])))
    
print(min_cost)


### FIXED CODE ###

# coding: utf-8
# Your code here!

N, K = map(int, input().rstrip().split(' '))
X = list(map(int, input().rstrip().split(' ')))

min_cost = int(1e10)
for i in range(K, N+1):
    min_cost = min(min_cost, X[i-1] - X[i-K] + min(abs(X[i-1]), abs(X[i-K])))
    
print(min_cost)
from collections import Counter

n = int(input())
nums = sorted(list(map(int, input().split())), reverse=True)

num_map = Counter(nums)

answer = 0
for num in nums:
    pair = (1 << (num.bit_length())) - num

    if num_map[num] > 0 and num_map[pair]:
        if num == pair and num_map[num] > 1:
            answer += 1
            num_map[num] -= 2
        else:
            answer += 1
            num_map[num] -= 1
            num_map[pair] -= 1

print(answer)

### FIXED CODE ###

s = input()

answer = 0
black_count = 0
for i in range(len(s)):
    if s[i] == "B":
        black_count += 1
    else:
        answer += black_count

print(answer)
if K >= One:
    print(One)
elif 0 < K < One:
    print(K)

### FIXED CODE ###


A, B, C, K = [int(x) for x in input().split()]


if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    lack = K - A - B
    print(A - lack)
def gc(x, y):
    while y > 0:
        x %= y
        x, y = y, x
    return x



a = int(input())
b = int(input())
print(gc(a,b))


### FIXED CODE ###

def GCD(x,y):

    if(x >= y):
        z = y
        w = x%y
    else:
        z = x
        w = y%x

    if(not(w == 0)):
        return GCD(z,w)
    else:
        return z

A = [int(i) for i in input().split()]
print(GCD(A[0],A[1]))

"""実行結果

100 55
5



66 77
11

"""
N = int(input())
D = []
count = 0

for n in range(N):
    input_line = input().split()
    if (int(input_line[0]) == int(input_line[1])):
        count += 1
        if count == 3:
            temp = 1
    elif(temp ==1):
        break
    else:
        count = 0

if count >= 3:
        print('Yes')

else:
        print('No')

### FIXED CODE ###

N = int(input())
D = []
count, temp = 0, 0

for n in range(N):
    input_line = input().split()
    if (int(input_line[0]) == int(input_line[1])):
        count += 1
        if count == 3:
            temp = 1
    elif(temp ==1):
        break
    else:
        count = 0

if count >= 3:
        print('Yes')

else:
        print('No')
a,b=map(int,input().split())

ptint("{0} {1} {2:.8f}".format,(a//b,a%b,a/b))


### FIXED CODE ###

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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))
H=input()
h=input()
W=input()
w=input()
x=(int(H)-int(h))*(int(W)-int(w))

### FIXED CODE ###

H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))
x = int(input().split(" "))
a = x[0] * x[1]
b = x[0] + x[1] + x[0] + x[1]
print(str(a) + str(b))


### FIXED CODE ###

x = input().split(" ")
a = int(x[0]) * int(x[1])
b = int(x[0]) + int(x[1]) + int(x[0]) + int(x[1])
print(str(a) +" " + str(b))
import sys

def gcd(x, y, *val):
    val = [x, y] + list(val)
    val.sort(reverse=True)
    count = len(val)

    if count == 2:
        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        if count % 2 == 1:
            val.append(min(val))

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, count, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    if num == 2:
        print(max(input))
        return

    for i in range(num):
        mem = input.pop(num - 1 - i)
        gcd_max = max(gcd_max, gcd(*input, *input_mem))
        input_mem.append(mem)

    print(gcd_max)



if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def gcd(x, y, *val):
    val = sorted([x, y], reverse=True) + list(val)
    count = len(val)

    if count == 2:
        if val[1] == 0:
            return val[0]

        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        if count % 2 == 1:
            val.append(val[-1])

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, count, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    if num == 2:
        print(max(input))
        return

    gcd_left = [0]
    gcd_right = [0]

    for i in range(num - 1):
        gcd_left.append(gcd(input[i], gcd_left[i]))
        gcd_right.append(gcd(input[-1 - i], gcd_right[i]))

    gcd_right.reverse()
    gcd_list = []

    for i in range(num):
        gcd_list.append(gcd(gcd_left[i], gcd_right[i]))

    print(max(gcd_list))



if __name__ == "__main__":
    main()
import collections 
N=int(input())
T=[list(map(int,input().split())) for _ in range(N)]
T.sort(reverse=True)
TMP=[]
if N==1:
    print(1)
else:
    for i in range(N-1):
        for b in range(i,N-1):
            TMP.append((T[i][0]-T[b+1][0],T[i][1]-T[b+1][1]))
c=collections.Counter(TMP)
print(N-c.most_common(n=1)[0][1])

### FIXED CODE ###

import collections 
N=int(input())
T=[list(map(int,input().split())) for _ in range(N)]
T.sort(reverse=True)
TMP=[]
if N==1:
    print(1)
else:
    for i in range(N-1):
        for b in range(i,N-1):
            TMP.append((T[i][0]-T[b+1][0],T[i][1]-T[b+1][1]))
    c=collections.Counter(TMP)
    print(N-c.most_common(n=1)[0][1])
N = map(int, input())

C = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""

for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N - m + 26**i
    n = i-1
    break

for i in revesed(range(n)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + C[a]

print(ans)
  

### FIXED CODE ###

N = int(input())

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)
n, b=list(map(int,input().split()))

import math

x=int(min(n-b+1,b))

for i in range(1,x+1):
	if n-b+1<i or b-1<i-1:
		break
	y=math.factorial(n-b+1)/math.factorial(n-b+1-i)/math.factorial(i)
	z=math.factorial(b-1)/math.factorial(b-i)/math.factorial(i-1)
	res=int(y*z%(1000000000+7))
	print(res)

### FIXED CODE ###

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

import math

#x=int(min(n-b+1,b))

#if n==b:
#  print('1')
#  for i in range(b-1):
#    print('0')
#else:
#for i in range(1,x+1):
for i in range(1,b+1):
	if i-1 > n-b:
	# 境界を i-1 個作らなければならないが、赤いボールの数 n-k よりもこれが多いと条件を満たす置き方は存在しない
		print(0)
 	#if n-b+1<i or b-1<i-1:
		#break
	else:
		y=math.factorial(n-b+1)//(math.factorial(n-b+1-i)*math.factorial(i))
		z=math.factorial(b-1)//(math.factorial(b-i)*math.factorial(i-1))
		res=int(y*z%(1000000000+7))
		print(res)


#from math import factorial
 
#N, K= map(int, input().split())
 
#def ncr(n, r):
#    return factorial(n) // (factorial(r) * factorial(n - r)) 
 
#for i in range(1, K+1):
#    if i <= N-K+1:
#        print(ncr(K-1, i-1) * ncr(N-K+1, i) % (10**9 + 7))
#    else:
#        print(0)
a, b = input().split()
ab = int(a + b)
for _ in range(100000):
  if ab == i^2:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

a, b = input().split()
ab = int(a + b)
ans = False
for i in range(100000):
    if ab == i**2:
        ans = True
    else:
        continue
if ans == True:
    print('Yes')
elif ans == False:
    print('No')
S = int(raw_input())

h = S / 3600
m = S - 3600*h
s = m % 60
m = m - s

print h,
print ???:???,
print m,
print ???:???,
print s

### FIXED CODE ###

S = int(raw_input())

h = S / 3600
m = S - 3600*h
s = m % 60
m = (m - s)/60

print str(h) + ":" + str(m) + ":" + str(s)
S = input()
def saiki(i,s=S[0]):
    if i == 3:
        if eval(s) == 7:
            print(str(s) + "=7")
            exit()
    saiki(i+1,s+"+"+S[i+1])
    saiki(i+1,s+"-"+S[i+1])

saiki(0)



### FIXED CODE ###

import sys
a,b,c,d=[i for i in input()]
op=["+","-"]
for i in op:
  for j in op:
    for k in op:
      if eval(a+i+b+j+c+k+d)==7:
        print(a+i+b+j+c+k+d+"=7")
        sys.exit()
import math
a, b = map(int, input().split())

print(int(a*b / math.gcd(a,b)))


### FIXED CODE ###

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

print(int(a*b / fractions.gcd(a,b)))
S=input()
MOD=10**9+7
dp=[0]*13
dp[0]=1
for i in range(len(S)):
    new_dp=[0]*13
    s=S[-1-i]
    if s=="?":
        for j in range(10):
            rem=(j*10**i)%13
            for k in range(13):
                new_dp[(k+rem)%13]+=dp[k]
    else:
        rem=(int(s)*10**i)%13
        for k in range(13):
            new_dp[(k+rem)%13]+=dp[k]
    for l in range(13):
        new_dp[l]%=MOD
    dp=new_dp
print(dp[5])

### FIXED CODE ###

a,b=map(int,input().split())
if (a+b)%2==1:print("IMPOSSIBLE")
else:print((a+b)//2)
s = input()
t = input()
a =[]
for i in range(len(s)-len(t)+1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
    if f == True:
        a.append(i)

s = s.replace('?','a')

print(s[:a[-1]]+t+s[a[-1]+len(t):])


### FIXED CODE ###

s = input()
t = input()
a =[]
for i in range(len(s)-len(t)+1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
    if f == True:
        a.append(i)

s = s.replace('?','a')
if len(a) !=0:
    print(s[:a[-1]]+t+s[a[-1]+len(t):])
else:
    print('UNRESTORABLE')
from collections import deque

n, m, k = map(int, input().split())
a = deque(map(int, input().split()))
b = deque(map(int, input().split()))

a.append(10 ** 10)
b.append(10 ** 10)
na = a.popleft()
nb = b.popleft()

cnt = 0
min = 0
while min <= k:
    if na <= nb:
        cnt += 1
        min += na
        na = a.popleft()
    elif na > nb:
        cnt += 1
        min += nb
        nb = b.popleft()
    elif na == 10 ** 10 and nb == 10 ** 10:
        cnt += 1
        break
print(cnt-1)

### FIXED CODE ###

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

na, nb = [0], [0]
for i in range(n):
    na.append(na[i] + a[i])
for j in range(m):
    nb.append(nb[j] + b[j])

ans, j = 0, m
for i in range(n + 1):
    if na[i] > k:
        break
    while nb[j] > k - na[i]:
        j -= 1
    ans = max(ans, i + j)
    
print(ans)
s=input()
ind =0
len_s=len(s)
s = s+ "zzzzzzzzzz"

A = "dreamer"
B= "dream"
C= "erase"
D="eraser"

flag =True
while(1):
    if(s[ind] =="d"):
        if(s[ind + 5] =="d"):
            if(s[ind:ind+5]!=B):
                flag = False
                break
            else:
                ind+=5
        else:
            if(s[ind+5]!='e'):
                flag=False
                break
            if(s[ind+7] == "a"):
                if(s[ind:ind+5]!=B):
                    flag = False
                    break
                else:
                    ind+=5

            else:
                if(s[ind:ind+7] !=A):
                    flag = false
                    break
                else:
                    ind+=7
    elif(s[ind]=="e"):
        if(s[ind+5]=="r"):
            if(s[ind:ind+6]!=D):
                flag = False
                break
            else:
                ind+=6

        else:
            if(s[ind:ind +5] !=C):
                flag =False
                break
            else:
                ind+=5
    else:
        flag=False
        break
    if(ind == len_s):
        break
    if(ind > len(s)):
        flag=False
        break
if(flag):
    print("YES")
else:
    print("NO")



### FIXED CODE ###

s=input()
ind =0
len_s=len(s)
s = s+ "AAAAAAAAA"

A = "dreamer"
B= "dream"
C= "erase"
D="eraser"

flag =True
while(1):
    if(s[ind] =="d"):
        if(s[ind + 5] =="d"):
            if(s[ind:ind+5]!=B):
                flag = False
                break
            else:
                ind+=5
        else:
            if(s[ind+5]!='e' and s[ind+5]!='A'):
                flag=False
                break
            if(s[ind+7] == "a" or ind + 7 >len_s):
                if(s[ind:ind+5]!=B):
                    flag = False
                    break
                else:
                    ind+=5

            else:
                if(s[ind:ind+7] !=A):
                    flag = False
                    break
                else:
                    ind+=7
    elif(s[ind]=="e"):
        if(s[ind+5]=="r"):
            if(s[ind:ind+6]!=D):
                flag = False
                break
            else:
                ind+=6

        else:
            if(s[ind:ind +5] !=C):
                flag =False
                break
            else:
                ind+=5
    else:
        flag=False
        break
    if(ind == len_s):
        break
    if(ind > len_s):
        flag=False
        break
if(flag):
    print("YES")
else:
    print("NO")
strlist = input().rstrip().split("")
evenset = set()
oddset = set()

for i in range(len(strlist)):
  if i % 2 == 0:
    evenset.add(setlist[i])
  else:
    oddset.add(setlist[i])

if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")

else:
  print("No")



    



### FIXED CODE ###

moji = input().rstrip()
mojilist = list(moji)
evenset = set()
oddset = set()

for i in range(len(mojilist)):
  if i % 2 == 0:
    oddset.add(mojilist[i])
  else:
    evenset.add(mojilist[i])

if ((oddset <= {"R","U","D"}) and (evenset <= {"L","U","D"})):
  print("Yes")
else:
  print("No")
#atcoder_RedAndBlueBalls

import numpy as np 
from math import factorial as fact

MAX = pow(10,9)+7


def C(n,m):
    return (fact(n)//(fact(m)*fact(n-m))) 

n,k = input().split()
n,k = int(n),int(k) 

for i in range(k):
    ans = (C(n-k+1,i+1) * C(k-1,i) ) % MAX 
    print (ans)



### FIXED CODE ###

#atcoder_RedAndBlueBalls

import numpy as np 

MAX = pow(10,9)+7

def fact(n):
    ls = [1] 
    for i in range(1,n+1):
        ls.append(ls[i-1]*i) 
    return(ls) 

n,k = input().split()
n,k = int(n),int(k) 

ls = fact(2000)

def C(n,m):
    return ((ls[n]//(ls[m]*ls[n-m])) % MAX)

for i in range(k):
    ans = ( C(n-k+1,i+1) * C(k-1,i) ) % MAX 
    print (ans)
import sys
n, k = map(int, input().split())

bai = 1
k_arr = []
while bai * k <= n:
    k_arr.append(bai * k)
    bai += 1


if k % 2 == 0:
    bai2 = 1
    k_arr2 = []
    while bai2 * k/2 <= n:
        k_arr2.append(bai2 * k/2)
        bai2 += 1
        k_arr2_len = len(k_arr2) - len(k_arr)
    print(len(k_arr)*len(k_arr)*len(k_arr) + k_arr2_len*k_arr2_len*k_arr2_len)

else:
    print(len(k_arr)*len(k_arr)*len(k_arr))


### FIXED CODE ###

import sys
n, k = map(int, input().split())

bai = 1
k_arr = []
while bai * k <= n:
    k_arr.append(bai * k)
    bai += 1


if k % 2 == 0:
    bai2 = 1
    k_arr2 = []
    k_arr2_len = 0 - len(k_arr2)
    while bai2 * k/2 <= n:
        k_arr2.append(bai2 * k/2)
        bai2 += 1
        k_arr2_len = len(k_arr2) - len(k_arr)
    print(len(k_arr)*len(k_arr)*len(k_arr) + k_arr2_len*k_arr2_len*k_arr2_len)

else:
    print(len(k_arr)*len(k_arr)*len(k_arr))
import math

n = int(input())
arr = [int(x) for x in input().split()]

count = 0
max_even = 0
for x in arr:
   if x % == 2 and x > max_even:
      max_even = x 

print(math.log2(max_even))


### FIXED CODE ###

n = int(input())
arr = [int(x) for x in input().split()]

def countTwoInFactor(n):
   def countTwoInFactori(n, acc):
      return countTwoInFactori(n / 2, acc + 1) if n % 2 == 0 else acc
   return countTwoInFactori(n, 0)

arr2 = [countTwoInFactor(x) for x in arr]
arr2.sort()
print(arr2[0])
N = int(input())
L0 = 2
L1 = 1
for i in range(N - 1):
    L2 = L1 + L0
    L0 = L1
    L1 = L2

print(L2)


### FIXED CODE ###

N = int(input())
L0 = 2
L1 = 1
L2 = 1
for i in range(N - 1):
    L2 = L1 + L0
    L0 = L1
    L1 = L2

print(L2)
n, q = map(int, input().split())
ans = [0]*n
AB = [[] for _ in range(n-1)]
for i in range(n-1):
    AB[i] = list(map(lambda x: x-1, map(int, input().split())))
AB.sort(key=lambda x: x[1])

for (a,b) in AB:
    T[a] = T[a].union(T[b])

for i in range(q):
    p, x = map(int, input().split())
    ans[p-1] += x

for (a,b) in AB:
    ans[b] += ans[a]

print(*ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n, q = map(int, input().split())
G = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(lambda x: x-1, map(int, input().split()))
    G[a].append(b)
    G[b].append(a)

ans = [0]*n
for i in range(q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(v, pre=-1):  
    for nx in G[v]:
        if nx==pre:
            continue
        ans[nx] += ans[v]
        dfs(nx,v)
dfs(0)
print(*ans)
def Ics(x, y):
    a = len(x)
    b = len(y)
    c1 = [0] * (b + 1)

    for i in range(a):
        d = x[i]
        c2 = c1[:]
        for j in range(n):
            if d == y[j]:
                c1[j + 1] = c2[j] + 1
            elif c1[j + 1] < c1[j]:
                c1[j + 1] = c1[j]
    return c1[-1]

q = int(input())
for k in range(q):
    x = input()
    y = input()
    print(Ics(x, y))

### FIXED CODE ###

def Ics(x, y):
    a = len(x)
    b = len(y)
    c1 = [0] * (b + 1)

    for i in range(a):
        d = x[i]
        c2 = c1[:]
        for j in range(b):
            if d == y[j]:
                c1[j + 1] = c2[j] + 1
            elif c1[j + 1] < c1[j]:
                c1[j + 1] = c1[j]
    return (c1[-1])

q = int(input().rstrip())
r = []
for k in range(q):
    s1 = input().rstrip()
    s2 = input().rstrip()
    r.append(Ics(s1, s2))

print(*r, sep = "\n")
n,k = map(int,input().split())
h = list(map(int,input().split()))

ans = 0

for i in h:
    if i >= k:
        ans += 1

print(ans)

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
  p = (n/2)/n
  print(p)
else:
  p = (n/2+0.5)/n
  print(p)
import math
A=int(input())
B =float(input())
print(math.floor(A*B))

### FIXED CODE ###

import math
li = input().split()
A=int(li[0])
B=li[1].split(".") #整数部分と小数部分に分割

B_int=int(B[0])
B_point=int(B[1])

print(A*B_int+(A*B_point)//100)
import math
i = 0
a = 0
N, D = map(int, input().split())

while(i < N)
    X, Y = map(int, input().split())
    j = math.sqrt(X ** 2 + Y ** 2)
    if j <= D:
        a+=1
    i+=1

print(a)


### FIXED CODE ###

import math
i = 0
a = 0
N, D = map(int, input().split())

while(i < N):
    X, Y = map(int, input().split())
    j = math.sqrt(X ** 2 + Y ** 2)
    if j <= D:
        a+=1
    i+=1

print(a)
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

N = ii()
xyh = li2(N)

for c_x in range(101):
    for c_y in range(101):
        flag = 0
        left = 1
        right = float('inf')
        for i in range(N):
            tmp = xyh[i][2] + abs(c_x-xyh[i][0]) + abs(c_y-xyh[i][1])
            if tmp < 1 or not (left <= tmp <= right):
                    flag = 1
                    break
            if xyh[i][2] > 0:
                left = right = tmp
            else:
                right = tmp
        if not flag:
            print(c_x, c_y, tmp)
            exit()
print(xyh[N+1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

N = ii()
xyh = li2(N)

for c_x in range(101):
    for c_y in range(101):
        flag = 0
        left = 1
        right = float('inf')
        for i in range(N):
            #print(i, left, right)
            tmp = xyh[i][2] + abs(c_x-xyh[i][0]) + abs(c_y-xyh[i][1])
            #print(tmp, xyh[i][2])
            if xyh[i][2] > 0:
                if not(left <= tmp <= right):
                    flag = 1
                    break
                left = right = tmp
            else:
                if tmp < 1 or left > tmp:
                    flag = 1
                    break
                right = min(right, tmp)
        if not flag:
            print(c_x, c_y, right)
            exit()
mod = 10 ** 9 + 7

n,m = map(int,input().split())
lis = [int(input()) for x in range(m)]

stairs = [0 for x in range(n)]
stairs[0] = 1
if 1 in lis:
    stairs[1] = 0
else:
    stairs[1] = 1
#print(stairs)
f = 0
for x in range(2,n):
    if x in lis:
        stairs[x] = 0
    else:
        stairs[x] = (stairs[x-1] + stairs[x-2]) % mod
    
#print(stairs)
print((stairs[n-1] + stairs[n-2]) % mod)

### FIXED CODE ###

import sys
mod = 10 ** 9 + 7

n,m = map(int,input().split())
if n in [0,1]:
    print(1)
    sys.exit()
    
if not m == 0: lis = [int(input()) for x in range(m)]
else: lis = [-1]
val1 = 1
if 1 in lis: val2 = 0
else: val2 = 1

if lis[0] == 1 and len(lis) >= 2:
    flg = lis[1]
    nex = 1
else:
    flg = lis[0]
    nex = 0
#print(lis)
for x in range(2,n):
    if x == flg: #x in lis
        #print(flg)
        nex += 1
        try: flg = lis[nex]
        except:flg = 0
        now = 0
    else:
        now = (val1 + val2) % mod
    val1,val2 = val2,now
    
print((val1 + val2) % mod)
n = int(input())

s = 0
i = 0
while s < n:
    s += i
    i += 1

if i == 1:
    print(1)
    exit()
ans = list(range(1,i))
ans.remove(s-n)
print('\n'.join(map(str,ans)))


### FIXED CODE ###

n = int(input())

s = 0
i = 0
while s < n:
    s += i
    i += 1

if i == 1:
    print(1)
else:
    ans = list(range(1,i))
    if s - n != 0: ans.remove(s-n)
    print('\n'.join(map(str,ans)))
a, b, c, k = map(int, input().split())
ans = 0

if k - a >= 0:
  k -= a
  if k - b >= 0:
    k -= b:
    if k - c >= 0:
      ans = a - c
    else:
      ans = a - k
  else:
    ans = a
else:
  ans = k
  
print(ans)

### FIXED CODE ###

a, b, c, k = map(int, input().split())
ans = 0
 
if k - a >= 0:
  k -= a
  if k - b >= 0:
    k -= b
    if k - c >= 0:
      ans = a - c
    else:
      ans = a - k
  else:
    ans = a
else:
  ans = k
  
print(ans)
n = int(input())
st = [input().split() for _ in range(n)]
x = input()
flag = False
ans = 0
for s, t in st:
    if flag:
        ans += int(t)
    if s == x:
        flag = True
print(ans

### FIXED CODE ###

n = int(input())
st = [input().split() for _ in range(n)]
x = input()
flag = False
ans = 0
for s, t in st:
    if flag:
        ans += int(t)
    if s == x:
        flag = True
print(ans)