CodeEff/ECCO huggingface dataset:
# Original solution
n, m = (int(i) for i in input().split())
a = [int(eval(input())) for i in range(m)]

def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

l = []
pre = -1
for x in a:
    if x-pre == 1:
        print((0))
        exit()
    l.append(Fib(x-pre-1 +1))
    pre = x

l.append(Fib(n-pre +1))

res = 1
for x in l:
    res *= x

print((res % 1000000007))

# Optimized solution
n, m = (int(i) for i in input().split())
a = [int(eval(input())) for i in range(m)]

def Fib(n1):
    a1, b1 = 0, 1
    if n1 == 1:
        return a1
    elif n1 == 2:
        return b1
    else:
        for i in range(n1-2):
            a1, b1 = b1, a1 + b1
        return b1

l = []
pre = -1
for x in a:
    if x-pre == 1:
        print((0))
        exit()
    l.append(Fib(x-pre-1 +1))
    pre = x

l.append(Fib(n-pre +1))

res = 1
for x in l:
    res *= x

print((res % 1000000007))
# Original solution
N, M = list(map(int, input().split()))
a = [-10]
ans = -1
MOD = 10 ** 9 + 7
if N == 1:
    ans = 1
else:
    for i in range(M):
        a += [int(eval(input()))]
        if a[i + 1] - a[i] == 1:
            ans = 0
            break
if not ans in [0, 1]:
    memo = [0] * (N + 1)
    memo[0] = 1
    if 1 in a:
        memo[1] = 0
    else:
        memo[1] = 1
    for i in range(N - 1):
        if i + 2 in a:
            continue
        memo[i + 2] = memo[i] + memo[i + 1]
        memo[i + 2] = memo[i + 2] % MOD
    else:
        ans = memo[i + 2]
print(ans)

# Optimized solution
N, M = list(map(int, input().split()))
a = []
ans = -1
MOD = 10 ** 9 + 7
if N == 1:
    ans = 1
else:
    if M > 0:
        a += [int(eval(input()))]
    for i in range(M - 1):
        a += [int(eval(input()))]
        if a[i + 1] - a[i] == 1:
            ans = 0
            break
    a.append([-1])
if not ans in [0, 1]:
    memo = [0] * (N + 1)
    memo[0] = 1
    memo[1] = 1
    try:
        if a[0] == 1:
            a.pop(0)
            memo[1] = 0
    except:
        pass
    j = 0
    for i in range(N - 1):
        if i + 2 == a[j]:
            j += 1
            continue
        memo[i + 2] = memo[i] + memo[i + 1]
        memo[i + 2] = memo[i + 2] % MOD
    else:
        ans = memo[i + 2]
print(ans)
# Original solution
INF = (10 ** 9) + 7
N, M = list(map(int, input().split()))

aLst = set(int(eval(input())) for i in range(M))
ansLst = [0] * (N + 1)
ansLst[0] = 1

for i in range(1, N + 1):
    if i in aLst:
        continue
    tmp = ansLst[i - 1]
    if i > 1:
        tmp += ansLst[i - 2]
    ansLst[i] = tmp % INF


print((ansLst[N]))


# Optimized solution
INF = 10 ** 9 + 7

N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
dp = [0] * (N + 1)
for i in range(M):
    dp[a[i]] = -1

dp[0] = 1
for i in range(1, N + 1):
    if dp[i] == -1: continue
    tmp = 0
    if dp[i - 1] != -1:
        tmp += dp[i - 1]
    if dp[i - 2] != -1 and i > 1:
        tmp += dp[i - 2]
    dp[i] = tmp % INF

print((dp[N]))
# Original solution
MOD=10**9+7
N,M=list(map(int,input().split()))
A=[0]*M

for i in range(M):
    A[i]=(int(eval(input()))+1)

S=[0]*(N+2)
S[1]=1
for i in range(2,N+2):
    if(i not in A):
        S[i]=(S[i-1]+S[i-2])%MOD
    else:
        S[i]=0
print((S[N+1]))

# Optimized solution
MOD=10**9+7
N,M=list(map(int,input().split()))
A=[True]*(N+2)

for i in range(M):
    a=(int(eval(input()))+1)
    A[a]=False

S=[0]*(N+2)
S[1]=1
for i in range(2,N+2):
    if(A[i]):
        S[i]=(S[i-1]+S[i-2])%MOD
    else:
        S[i]=0
print((S[N+1]))
# Original solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
inf = float("inf")
dp = [inf] * (N+1)
dp[0] = 1
for i in range(1,N+1):
	if i in A:
		continue

	if i == 1:
		dp[i] = dp[0]
		continue

	a = dp[i-2] if dp[i-2] != inf else 0
	b = dp[i-1] if dp[i-1] != inf else 0

	dp[i] = (a + b) % 1000000007


print((dp[N]))

# Optimized solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
inf = float("inf")
dp = [0] * (N+1)
for i in A:
	dp[i] = inf
dp[0] = 1
if dp[1] != inf:
	dp[1] = 1
for i in range(2,N+1):
	if dp[i] == inf:
		continue

	a = dp[i-2] if dp[i-2] != inf else 0
	b = dp[i-1] if dp[i-1] != inf else 0

	dp[i] = (a + b) % 1000000007


print((dp[N]))
# Original solution
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return eval(input())

def main():
    N, M = LI()
    A = []
    for _ in range(M):
        A.append(II())
    A.append(INF)
    dp = [0] * (N + 1)
    dp[0] = 1
    k = 0
    if A[0] == 1:
        dp[1] = 0
        k = 1
    else:
        dp[1] = dp[0]
    for i in range(2, N + 1):
        if i == A[k]:
            k += 1
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
    ans = dp[N]
    return ans

print((main()))

# Optimized solution
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return eval(input())

def main():
    N, M = LI()
    A = []
    for _ in range(M):
        A.append(II())
    A.append(INF)
    pre = 0
    cur = 1
    k = 0
    for i in range(1, N + 1):
        if i == A[k]:
            k += 1
            pre = cur
            cur = 0
        else:
            tmp = cur
            cur = (cur + pre) % MOD
            pre = tmp
    ans = cur
    return ans

print((main()))
# Original solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]
mod = 10**9 + 7

dp = [0]*(n+1)
dp[0] = 1
    
for i in range(1,n+1):
    if i in a:
        continue
    x = dp[i-1] 
    if i > 1:
        x += dp[i-2]
    dp[i] = x % mod
ans = dp[n]
print(ans)

# Optimized solution
n,m = list(map(int,input().split()))
a = {int(eval(input())) for _ in range(m)}
mod = 10**9 + 7

dp = [0]*(n+1)
dp[0] = 1
    
for i in range(1,n+1):
    if i in a:
        continue
    x = dp[i-1] 
    if i > 1:
        x += dp[i-2]
    dp[i] = x % mod
ans = dp[n]
print(ans)
# Original solution
import bisect


def typical_stairs(N: int, M: int, A: list)->int:
    MOD = 10**9 + 7

    A.sort()
    A.append(float('inf'))

    dp = [0] * (N+1)
    dp[0] = 1

    for i in range(N):
        if A[bisect.bisect_left(A, i+1)] == i+1:
            dp[i+1] = 0
        else:
            dp[i+1] = dp[i]
            if i > 0:
                dp[i+1] += dp[i-1]
                dp[i+1] %= MOD

    # print(dp)
    return dp[N]


if __name__ == "__main__":
    M = 0

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

    ans = typical_stairs(N, M, A)
    print(ans)


# Optimized solution
def typical_stairs(N: int, M: int, A: list)->int:
    MOD = 10**9 + 7

    dp = [0] * (N+1)
    dp[0] = 1

    ai = 0
    for i in range(N):
        if ai < M and A[ai] == i+1:
            dp[i+1] = 0
            ai += 1
        else:
            dp[i+1] = dp[i]
            if i > 0:
                dp[i+1] += dp[i-1]
                dp[i+1] %= MOD

    # print(dp)
    return dp[N]


if __name__ == "__main__":
    M = 0

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

    ans = typical_stairs(N, M, A)
    print(ans)
# Original solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]

MOD = 10**9 + 7

safe = [True] * (N+1)
for i in range(len(A)):
    safe[A[i]] = False

dp = [0] * (N+1)
dp[0] = 1
if safe[1]:
    dp[1] = 1

for i in range(2, N+1):
    if(safe[i]):
        dp[i] = dp[i-1] + dp[(i-2)]
        dp[i] = dp[i] % MOD
    else:
        dp[i] = 0

print((dp[N]))

# Optimized solution
MOD = 10**9 + 7
N,M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]

aa = [True] * (N+1)
for i in a:
    aa[i] = False

dp = [0] * (N+1)
dp[0] = 1
if aa[1]:
    dp[1] = 1

for i in range(2,N+1):
    if (aa[i] == False):
        dp[i] = 0
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] =  dp[i] % MOD
print((dp[N]))
# Original solution
n,m = list(map(int,input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5+10)]
for i in range(len(A)):
    B[A[i]] = 1

mod = 10**9 + 7

DP = [1,1]
if B[1] == 1:
    DP[1] = 0
for i in range(2,n+1):
    p1 = DP[i-2] % mod
    p2 = DP[i-1] % mod
    if B[i-2] == 1:
        p1 = 0
    if B[i-1] == 1:
        p2 = 0
    DP.append((p1+p2)%mod)
print((DP[n]))

# Optimized solution
n,m = list(map(int,input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5+10)]
for i in range(len(A)):
    B[A[i]] = 1

mod = 10**9 + 7

DP = [1,1]
if B[1] == 1:
    DP[1] = 0
for i in range(2,n+1):
    if B[i] == 0:
        DP.append((DP[i-1]+DP[i-2])%mod)
    else:
        DP.append(0)
    if i >= 3:
        DP[i-3]=0
print((DP[n]))
# Original solution
import sys
input = sys.stdin.readline
N, M = list(map(int,input().split()))
hole = [0] * (N+1)
for i in range(M):
    hole[int(eval(input()))] = 1
if N == 1:
    print((1))
    exit()
if N == 2:
    if hole[1] == 1:
        print((1))
        exit()
    if hole[1] == 0:
        print((2))
        exit()
flg_one = False
flg_two = False
first = 1
second = 2
if hole[1] == 1:
    first = 0
    second = 1
    flg_one = True
if hole[2] == 1:
    first = 1
    second = 0
    flg_two = True
if flg_one and flg_two:
    print((0))
    exit()

for i in range(3,N):
    if hole[i] == 1:
        first = second
        second = 0
        continue
    tmp = first + second
    tmp %= 1000000007
    first = second
    second = tmp
tmp = first + second
tmp %= 1000000007
print(tmp)

# Optimized solution
MOD = 10**9 + 7
N, M = list(map(int, input().split()))
stairs = [0]*(N+1)
for _ in range(M):
    stairs[int(eval(input()))] = 1
if N == 1:
    print((1))
    exit()
ans = [0]*(N+1)
ans[1] = 1 if stairs[1] == 0 else 0
ans[2] = 1 + ans[1] if stairs[2] == 0 else 0
for i in range(3,N+1):
    if stairs[i] == 1:
        ans[i] = 0
        continue
    ans[i] = (ans[i-1] + ans[i-2]) % MOD
print((ans[N]))
# Original solution
N,M = (int(i) for i in input().split())
a = [int(eval(input())) for i in range(M)]
hoge = [0] * N
if 1 not in a:
    hoge[0] = 1
if 2 not in a and N >= 2:
    hoge[1] = hoge[0] + 1

for i in range(2,N):
    if i + 1  not in a:
        hoge[i] += hoge[i - 1]
        hoge[i] += hoge[i - 2]

print((hoge[N-1] % (10**9 + 7)))

# Optimized solution
N, M = list(map(int, input().split()))
A = set(int(eval(input())) for _ in range(M))
mod = 10 ** 9 + 7

dp = [0] * (N+1)
dp[0] = 1
for i in range(1, N+1):
    if i in A:
        continue
    if i == 1:
        dp[i] = 1
        continue
    dp[i] = dp[i-1] + dp[i-2]

print((dp[N] % mod))
# Original solution
N,M = (int(i) for i in input().split())
a = [int(eval(input())) for i in range(M)]
hoge = [0] * N
if 1 not in a:
    hoge[0] = 1
if 2 not in a and N >= 2:
    hoge[1] = hoge[0] + 1

for i in range(2,N):
    if i + 1  not in a:
        hoge[i] = hoge[i - 1] + hoge[i - 2]

print((hoge[N-1] % (10**9 + 7)))

# Optimized solution
N,M = (int(i) for i in input().split())
a = set([int(eval(input())) for i in range(M)])
hoge = [0] * N
if 1 not in a:
    hoge[0] = 1
if 2 not in a and N >= 2:
    hoge[1] = hoge[0] + 1

for i in range(2,N):
    if i + 1  not in a:
        hoge[i] = hoge[i - 1] + hoge[i - 2]

print((hoge[N-1] % (10**9 + 7)))
# Original solution
n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]

dp = [0 for i in range(n+1)]
dp[0] = 1

for i in range(1, n+1):
    if i in A:
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print((dp[-1]))


# Optimized solution
n, m = list(map(int, input().split()))
A = [False for i in range(n+1)]
for i in range(m):
    a = int(eval(input()))
    A[a] = True

dp = [0 for i in range(n+1)]
dp[0] = 1

for i in range(1, n+1):
    if A[i]:
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print((dp[-1]))
# Original solution
n, m = list(map(int, input().split()))
stairs = [i for i in range(1, n+1)]
a = [0 for _ in range(m)]
for i in range(m):
  a[i] = int(eval(input()))
a = set(a)
  
dp = [0] * (n + 1)
dp[0] = 1

for i in range(1, n+1):
  if i in a:
    continue
  dp[i] = dp[i] + dp[i-1]
  if i > 1:
    dp[i] = dp[i] + dp[i-2]

print((dp[n] % 1000000007))

# Optimized solution
n, m = list(map(int, input().split()))
stairs = [i for i in range(1, n+1)]
a = [0 for _ in range(m)]
for i in range(m):
  a[i] = int(eval(input()))
a = set(a)
  
dp = [0] * (n + 1)
dp[0] = 1

for i in range(1, n+1):
  if i in a:
    continue
  dp[i] = dp[i-1]
  if i > 1:
    dp[i] += dp[i-2]

print((dp[n] % 1000000007))
# Original solution
MOD = 1000000007
N = 100001

fibo = [1, 1] + [0] * N
for i in range(2, N):
    fibo[i] = (fibo[i - 1] + fibo[i - 2]) % MOD

n, m = list(map(int, input().split(" ")))
a_list = [int(eval(input())) for _ in range(m)]
ngs = [i in a_list for i in range(n)]
ngs.append(False)
for i in range(n):
    if ngs[i] and ngs[i + 1]:
        print((0))
        exit()
cnts = []
cnt = 0

for ng in ngs:
    if ng:
        cnts.append(cnt)
        cnt = 0
        continue
    cnt += 1
cnts.append(cnt)
ans = 1
for c in cnts:
    if c != 0:
        ans *= fibo[c - 1]
# print(ngs)
# print(cnts)
print((ans % MOD))


# Optimized solution
MOD = 1000000007
N = 100001

fibo = [1, 1] + [0] * N
for i in range(2, N):
    fibo[i] = (fibo[i - 1] + fibo[i - 2]) % MOD

n, m = list(map(int, input().split(" ")))
a_list = [int(eval(input())) for _ in range(m)]
is_ngs = [0] * (n + 2)
for a in a_list:
    is_ngs[a] = 1
for i in range(n):
    if is_ngs[i] and is_ngs[i + 1]:
        print((0))
        exit()
cnts = []
cnt = 0

for i in range(n + 1):
    if is_ngs[i]:
        cnts.append(cnt)
        cnt = 0
        continue
    cnt += 1
cnts.append(cnt)
ans = 1
for c in cnts:
    if c != 0:
        ans *= fibo[c - 1]
# print(is_ngs)
# print(cnts)
print((ans % MOD))
# Original solution
MOD = 1000000007

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

count = [-1 for i in range(n+1)]
for i in range(m):
    count[int(eval(input()))] = 0

for i in range(1,n+1):
    if count[i] == 0:
        continue
    
    if i == 1:
        count[i] = 1 
    elif i == 2:
        count[i] = count[i-1] + 1
    else:
        count[i] = (count[i-1] + count[i-2]) % MOD

print((count[n]))


# Optimized solution
import sys
input = sys.stdin.readline

MOD = 1000000007

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

count = [-1] * (n+1)
for i in range(m):
    count[int(eval(input()))] = 0

for i in range(1,n+1):
    if count[i] == 0:
        continue
    
    if i == 1:
        count[i] = 1 
    elif i == 2:
        count[i] = count[i-1] + 1
    else:
        count[i] = (count[i-1] + count[i-2]) % MOD

print((count[n]))
# Original solution

MOD = 1000000007

def main():
    n,m = list(map(int,input().split()))
    al = [False for _ in range(n+1)]
    for i in range(m):
        a = int(eval(input()))
        al[a] = True
    
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0

    for i in range(2,n+1):
        if not al[i]:
            dp[i] = dp[i-2] + dp[i-1]

    print((dp[n] % MOD))


if __name__ == "__main__":
    main()

# Optimized solution

MOD = 1000000007

def main():
    n,m = list(map(int,input().split()))
    al = [False for _ in range(n+1)]
    for i in range(m):
        a = int(eval(input()))
        al[a] = True
    
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0

    for i in range(2,n+1):
        if not al[i]:
            dp[i] = (dp[i-2] + dp[i-1]) % MOD

    print((dp[n]))


if __name__ == "__main__":
    main()
# Original solution
# -*- coding: utf-8 -*-
import itertools as itr

N, M = list(map(int, input().split()))
a = [int(eval(input())) for x in range(M)]

def calc_routes(dan):
    tmp = 1
    for i in range(int(dan/2)):
        i += 1
        n = dan - i
        tmp += len(list(itr.combinations(list(range(n)), i)))

    return tmp

routes = 1
prev = 0
for x in a:
    if x == prev:
        routes = 0
        break
    else:
        dan = (x-1) - prev
        routes = (routes * calc_routes(dan)) % 1000000007
        prev = x+1

routes = (routes * calc_routes(N-prev)) % 1000000007
print((int(routes)))

# Optimized solution
# -*- coding: utf-8 -*-
from math import factorial

N, M = list(map(int, input().split()))
a = [int(eval(input())) for x in range(M)]

def fibo(dan):
    tmp = [1, 1]
    for i in range(2, dan+1):
        tmp.append(tmp[i-1] + tmp[i-2])
    return tmp[dan]

routes = 1
prev = 0
for x in a:
    if x == prev:
        routes = 0
        break
    else:
        dan = (x-1) - prev
        routes = (routes * fibo(dan))
        prev = x+1

routes = (routes * fibo(N-prev)) % 1000000007
print((int(routes)))
# Original solution
n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]
dp = [0] * (n + 1)
dp[0] = 1
if 1 in A:
  dp[1] = 0
else:
  dp[1] = 1

for i in range(2, n+1):
  if i in A:
    dp[i] = 0
  else:
    dp[i] = (dp[i-1] + dp[i-2]) % (10**9 + 7)
print((dp[n]))

# Optimized solution
n, m = list(map(int, input().split()))
A = set([int(eval(input())) for i in range(m)])
dp = [0] * (n + 1)
dp[0] = 1
if 1 in A:
  dp[1] = 0
else:
  dp[1] = 1

for i in range(2, n+1):
  if i in A:
    dp[i] = 0
  else:
    dp[i] = (dp[i-1] + dp[i-2]) % (10**9 + 7)
print((dp[n]))
# Original solution
MOD = 1000000007

N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)] + [N + 2]

dp, id = [0, 1], 0
for i in range(N):
    if A[id] - 1 == i:
        id += 1
        dp.append(0)
    else:
        dp.append(dp[-1] + dp[-2])

print((dp[-1] % MOD))


# Optimized solution
MOD = 1000000007

N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)] + [N + 10]

dp, id = [0, 1], 0
for i in range(N):
    if A[id] - 1 == i:
        id += 1
        dp.append(0)
    else:
        dp.append(dp[-1] + dp[-2])

print((dp[-1] % MOD))
# Original solution
#n段の上り方のバリエーションはフィボナッチ数列になっている

N, M = list(map(int,input().split()))
alist = list()
for _ in range(M):
    alist.append(int(eval(input())))


li = {}
li[0] = 1

for i in range(1,N+1):
    if i in alist:
        li[i] = 0
    else:
        if i == 1:
            li[i] = 1
        else:
            li[i] = ((li[i-1] + li[i-2])%(10**9+7))
print((li[N]%(10**9+7)))

# Optimized solution
N, M = list(map(int,input().split()))
alist = list()
for _ in range(M):
    alist.append(int(eval(input())))


li = {}
li[0] = 1

for i in range(1,N+1):
    if len(alist)>=1 and i ==  alist[0]:
        li[i] = 0
        alist.pop(0)
    else:
        if i == 1:
            li[i] = 1
        else:
            li[i] = ((li[i-1] + li[i-2])%(10**9+7))
print((li[N]%(10**9+7)))
# Original solution
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
# input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


m = Mod(10**9 + 7)


def slv(N, M, A):
    dp = [0] * (N+10)
    b = [False] * (N+10)
    for a in A:
        b[a] = True

    dp[0] = 1
    for i in range(N):
        if not b[i+1]:
            dp[i+1] = m.add(dp[i+1], dp[i])
        if not b[i+2]:
            dp[i+2] = m.add(dp[i+2], dp[i])
    return dp[N]


def main():
    N, M = read_int_n()
    A = [read_int() for _ in range(M)]
    print(slv(N, M, A))


if __name__ == '__main__':
    main()


# Optimized solution
# -*- coding: utf-8 -*-
import sys

sys.setrecursionlimit(100000)
# input = sys.stdin.readline


def read_int():
    return int(eval(input()))


def read_int_n():
    return list(map(int, input().split()))


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m


def slv(N, M, A):
    m = Mod(10**9 + 7)
    dp = [0] * (N+10)
    b = [False] * (N+10)
    for a in A:
        b[a] = True

    dp[0] = 1
    for i in range(N):
        if not b[i+1]:
            dp[i+1] = m.add(dp[i+1], dp[i])
        if not b[i+2]:
            dp[i+2] = m.add(dp[i+2], dp[i])
    return dp[N]


def main():
    N, M = read_int_n()
    A = [read_int() for _ in range(M)]
    print((slv(N, M, A)))


if __name__ == '__main__':
    main()
# Original solution
N, M = list(map(int, input().split()))
A = [True] * (N + 1)
for i in range(M):
    a = int(eval(input()))
    A[a] = False

dp = [0] * (N + 1)
dp[0] = 1
mod = 10 ** 9 + 7

for i in range(N):
    for j in range(i + 1, min(N, i + 2) + 1):
        if A[j]:
            dp[j] += dp[i]
            dp[j] %= mod
            # print(dp)

print((dp[N]))


# Optimized solution
N, M = list(map(int, input().split()))
A = [True] * (N + 1)
for _ in range(M):
    a = int(eval(input()))
    A[a] = False

dp = [0] * (N + 1)

dp[0] = 1
for i in range(N):
    for j in range(i + 1, min(N, i + 2) + 1):
        if A[j] is True:
            dp[j] += dp[i]
            dp[j] %= 10 ** 9 + 7

print((dp[N]))
# Original solution
import sys

n, m = list(map(int, input().split()))
aaa = set(map(int, sys.stdin))
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7

for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print((dp[n]))


# Optimized solution
import sys

n, m = list(map(int, input().split()))
if m > 0:
    aaa = set(map(int, sys.stdin))
else:
    aaa = set()
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7

for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print((dp[n]))
# Original solution
N, M = list(map(int, input().split()))

broken = []
for _ in range(M):
  broken.append(int(eval(input())))

mod = 10 ** 9 + 7
f2, f1 = 0, 1
for i in range(1, N + 1):
  if i in broken:
    if i - 1 in broken:
      print((0))
      exit()
    f2 = f1
    f1 = 0
    continue
  f = (f2 + f1) % mod
  f2 = f1
  f1 = f
print(f)

# Optimized solution
import sys
 
n, m = list(map(int, input().split()))
if m > 0:
    aaa = set(map(int, sys.stdin))
else:
    aaa = set()
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7
 
for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print((dp[n]))