CodeEff/ECCO huggingface dataset:
# Original solution
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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

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

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

ans = 1
a = -1
for i in range(M):
    b = int(eval(input()))
    c = b - a - 2
    if c < 0:
        print((0))
        sys.exit()
    else:
        ans = (ans * dp[c]) % mod
        a = b

ans = (ans * dp[N-a-1]) % mod

print(ans)

# Optimized solution
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N, M = list(map(int, input().split()))
a = set()
for i in range(M):
    a.add(int(eval(input())))

dp = [0 for i in range(N+1)]
dp[0] = 1
if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

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

print((dp[N] % mod))
# Original solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
MOD = 10**9+7
INF = -1
dp = [INF]*(n+1)
if n == 1:
    if 1 in a:
        print((0))
    else:
        print((1))
    exit()

dp[0] = dp[1] = 1

if 0 in a:
    dp[0] = INF
if 1 in a:
    dp[1] = INF

for i in range(2, n+1):
    if i in a:
        dp[i] = INF
        continue
    if dp[i-1] == INF and dp[i-2] == INF:
        break
    elif dp[i-1] == INF or dp[i-2] == INF:
        dp[i] = max(dp[i-1], dp[i-2])
    else:
        dp[i] = dp[i-1]+dp[i-2]
    dp[i] %= MOD


print((dp[n] if dp[n] != INF else 0))

# Optimized solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
MOD = 10**9+7
INF = MOD-1
dp = [INF]*(n+1)
if n == 1:
    if 1 in a:
        print((0))
    else:
        print((1))
    exit()

dp[0] = dp[1] = 1

if 0 in a:
    dp[0] = INF
if 1 in a:
    dp[1] = INF

for x in a:
    dp[x] = 0

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

    if dp[i-1] == INF and dp[i-2] == INF:
        break
    elif dp[i-1] == INF or dp[i-2] == INF:
        dp[i] = max(dp[i-1], dp[i-2])
    else:
        dp[i] = dp[i-1]+dp[i-2]
    dp[i] %= MOD


print((dp[n] if dp[n] != INF else 0))
# Original solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
MOD = 10**9+7
INF = MOD-1
dp = [INF]*(n+1)
if n == 1:
    if 1 in a:
        print((0))
    else:
        print((1))
    exit()

dp[0] = dp[1] = 1

for x in a:
    dp[x] = 0

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

    dp[i] = dp[i-1]+dp[i-2]
    dp[i] %= MOD


print((dp[n] if dp[n] != INF else 0))

# Optimized solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
MOD = 10**9+7
INF = MOD-1
dp = [INF]*(n+1)
dp[0] = dp[1] = 1

for x in a:
    dp[x] = 0

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


print((dp[n] if dp[n] != INF else 0))
# Original solution
OK = "O"
BRO = "B"
MOD = 1000000007

N,M=list(map(int, input().split()))
Broken=[int(eval(input())) for i in range(M)]
K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))

dp=[0 for i in range(N+1)]
dp[0]=1
for i in range(N):
  for j in range(i+1,min(i+2+1,N+1)):
    if K[j]==OK:
      dp[j]+=dp[i]
      dp[j]%=MOD
      
print((dp[N]))


# Optimized solution
OK = 0
BRO = 1
MOD = 1000000007

N,M=list(map(int, input().split()))
Broken=[int(eval(input())) for i in range(M)]
#K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N+1))
for i in range(M):
  K[Broken[i]] = 1
  
dp=[0 for i in range(N+1)]
dp[0]=1
for i in range(N):
  for j in range(i+1,min(i+2+1,N+1)):
    if K[j]==OK:
      dp[j]+=dp[i]
      dp[j]%=MOD
      
print((dp[N]))
# Original solution
OK = 0
BRO = 1
MOD = 1000000007

N,M=list(map(int, input().split()))
Broken=[int(eval(input())) for i in range(M)]
#K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N+1))
for i in range(M):
  K[Broken[i]] = 1
  
dp=[0 for i in range(N+1)]
dp[0]=1
for i in range(N):
  for j in range(i+1,min(i+2+1,N+1)):
    if K[j]==OK:
      dp[j]+=dp[i]
      dp[j]%=MOD
      
print((dp[N]))


# Optimized solution
OK = 0
BRO = 1

N,M=list(map(int, input().split()))
Broken=[int(eval(input())) for i in range(M)]
#K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N+1))
for i in range(M):
  K[Broken[i]] = 1
  
if N == 1:
  print((1))
  exit()
  
c=[0 for i in range(N+1)]
if K[N-1]==OK:
  c[1]=1
if K[N-2]==OK and K[N-1]==OK:
  c[2]=2
if K[N-2]==OK and K[N-1]==BRO:
  c[2]=1

for i in range(3,N+1):
  if K[N-i]==OK:
    if K[N-i+1]==OK and K[N-i+2]==OK:
      c[i]=c[i-1]+c[i-2]
    if K[N-i+1]==OK and K[N-i+2]==BRO:
      c[i]=c[i-1]
    if K[N-i+1]==BRO and K[N-i+2]==OK:
      c[i]=c[i-2]
  c[i]%=1000000007
  
print((c[N] % 1000000007))
# Original solution
N, M = list(map(int, input().split()))
lista = []
for m in range(M):
    am = int(eval(input()))
    lista. append(am)
an = 0
an1 = 1 
for n in range(N):
    if n+1 in lista:
        an, an1 = an1, 0
    else:
        an, an1 = an1, (an+an1)%1000000007
print(an1)    


# Optimized solution
N, M = list(map(int, input().split()))
lista = []
for m in range(M):
    am = int(eval(input()))
    lista.append(am)
lista.append(0)    
an = 0
an1 = 1 
for n in range(N):
    if n+1 == lista[0]:
        del lista[0]
        #print(lista)
        an, an1 = an1, 0
    else:
        an, an1 = an1, (an+an1)%1000000007
print(an1)
# Original solution
N , M = (int(a) for a in input().split())
stair = [1]
brake = []
for i in range(1 , M+1) :
    a = int(eval(input()))
    brake.append(a)

for i in range(1, N+1) :
    if i in brake :
        stair.append(0)
    elif i == 1 : 
        stair.append(1) 
    else : stair.append((stair[i-1] + stair[i-2]) % (10**9+7))
         
print((stair[N]))





# Optimized solution
N , M = (int(a) for a in input().split())
stair = [1]*(N+1)
for i in range(1 , M+1) :
    a = int(eval(input()))
    stair[a] = 0
 
for i in range(2, N+1) :
    stair[i] *= (stair[i-1] + stair[i-2]) % (10**9+7)
         
print((stair[N]))
# Original solution
from sys import stdin
INF = int(1e9+7)


def modadd(a, b):
    # aとbを足した値をmodする(a + b mod p)
    return (a + b) % INF


def main():
    lines = stdin.readlines()
    N = int(lines[0].split()[0])
    M = [True] * (N + 1)
    for i in map(int, lines[1:]):
        M[i] = False
    dp = [0] * (N + 1)
    dp[0] = 1
    for cur in range(N + 1):
        for i in range(cur + 1, min(cur + 2, N) + 1):
            if M[i]:
                dp[i] = modadd(dp[cur], dp[i])
    print((dp[N]))
    return


main()


# Optimized solution
from sys import stdin
INF = int(1e9+7)


def modadd(a, b):
    # aとbを足した値をmodする(a + b mod p)
    return (a + b) % INF


def main():
    lines = stdin.readlines()
    N = int(lines[0].split()[0])
    M = [True] * (N + 1)
    for i in map(int, lines[1:]):
        M[i] = False
    dp = [0] * (N + 1)
    dp[:2] = 1, 1 if M[1] else 0
    for i in range(2, N + 1):
        if M[i]:
            dp[i] = modadd(dp[i - 1], dp[i - 2])
    print((dp[N]))
    return


main()
# Original solution
import sys
input = sys.stdin.readline
n,m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
mod = (10**9)+7
dp = [1] + [0]*(n)
for i in range(1,n+1):
    if i in a:
        dp[i] == 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod
print((dp[-1]))

# Optimized solution
import sys
input = sys.stdin.readline
n,m = list(map(int, input().split()))
A = set()
for i in range(m):
    a = int(eval(input()))
    A.add(a)
mod = (10**9)+7
dp = [1] + [0]*(n)
for i in range(1,n+1):
    if i in A:
    #リストに対するinは激遅なのでset
        dp[i] == 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod
print((dp[-1]))
# 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
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:
      dp[i]=0
print((dp[n]))

# Optimized solution
n,m=list(map(int,input().split()))
fib=[0]*(n+2)
fib[0]=0
fib[1]=1
for i in range(n):
  fib[i+2]=fib[i]+fib[i+1]
ans=1
k=0
for i in range(m):
  a=int(eval(input()))
  ans*=fib[a-k]
  k=a+1
ans*=fib[n-k+1]
print((ans%1000000007))
# Original solution
mod = 1000000007

def add(a, b):
    return (a + b) % mod

def sub(a, b):
    return (a + mod - b) % mod

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
    
a = []
N, M = list(map(int, input().split()))
for i in range(M):
    a.append(int(eval(input())))

results = []

flag = True

for m in range(1, M):
    if a[m] - a[m - 1] == 1:
        flag = False
        break

flag_end = True
if M == 0:
    flag_end = False

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

if flag and flag_end:
    for m in range(M):
        if m == 0:
            results.append(Fib(a[m] + 1))
        else:
            results.append(Fib(a[m] - a[m - 1]))
    results.append(Fib(N - a[m] + 1))
    result = 1
    for i in range(len(results)):
        result = mul(result, results[i])
    print((result % mod))
elif not flag:
    print((0))
else:
    print((Fib(N + 2) % mod))















# Optimized solution
mod = 1000000007

def add(a, b):
    return (a + b) % mod

def sub(a, b):
    return (a + mod - b) % mod

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
    
a = []
N, M = list(map(int, input().split()))
for i in range(M):
    a.append(int(eval(input())))

def main():
  results = []

  flag = True

  for m in range(1, M):
      if a[m] - a[m - 1] == 1:
          flag = False
          break

  flag_end = True
  if M == 0:
      flag_end = False

  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

  if flag and flag_end:
      for m in range(M):
          if m == 0:
              results.append(Fib(a[m] + 1))
          else:
              results.append(Fib(a[m] - a[m - 1]))
      results.append(Fib(N - a[m] + 1))
      result = 1
      for i in range(len(results)):
          result = mul(result, results[i])
      print((result % mod))
  elif not flag:
      print((0))
  else:
      print((Fib(N + 2) % mod))

if __name__ == "__main__":
  main()
# Original solution
n, m = list(map(int,input().split()))
stairs = list([int(eval(input())) for i in range(m)])
dp = [0] * (n+1)
dp[0] = 1

for i in range(1, n+1):
    if i in stairs: 
        dp[i] = 0
        continue

    dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)

print((dp[n]))

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

for i in range(1, n+1):
    if i in stairs: 
        dp[i] = 0
        continue

    dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)

print((dp[n]))
# Original solution
N, M = list(map(int, input().split()))
a = [-1]
for i in range(M):
  a.append(int(eval(input())))

# a = [int(input()) for i in range(M)]
a.append(N+1)
# print(N,M)
# print(a)

diff = []
diffmax = 0
for i, v in enumerate(a):
  if i != len(a)-1:
    steps = a[i+1] - a[i]
    diff.append(steps)
    if diffmax < steps:
      diffmax = steps

#print(diff)
      
actptn = [0,1]
for i in range(2,diffmax):
  actptn.append(actptn[i-1] + actptn[i-2])
#print(len(actptn))

ans = 1
for i in diff:
  ans = (ans* actptn[i-1]) % 1000000007
print(ans)
 

# 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
if 1 not in A:
  dp[1] = 1

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

print((dp[-1]))
# Original 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
if 1 not in A:
  dp[1] = 1

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

print((dp[-1]))

# 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(n + 1):
  if i > 1:
    if i not in A:
      dp[i] += dp[i - 2]
  if i > 0:
    if i not in A:
      dp[i] += dp[i - 1]
  dp[i] %= MOD

print((dp[-1]))
# Original solution
def func(n):
  if n==1:return 1
  if n==0:return 1
  if dp[n]!=-1:return dp[n]
  f1=func(n-1) if n-1 not in a else 0
  f2=func(n-2) if n-2 not in a else 0
  tmp=(f1+f2)%1000000007
  dp[n]=tmp
  return tmp
import sys
sys.setrecursionlimit(1000000)
n,m=list(map(int,input().split()))
a=[int(eval(input())) for i in range(m)]
dp=[-1]*(n+1)
print((func(n)%1000000007))

# Optimized solution
def func(n):
  if n==1:return 1
  if n==0:return 1
  if dp[n]!=-1:return dp[n]
  f1=func(n-1) if n-1 not in a else 0
  f2=func(n-2) if n-2 not in a else 0
  tmp=(f1+f2)%1000000007
  dp[n]=tmp
  return tmp
import sys
sys.setrecursionlimit(1000000)
n,m=list(map(int,input().split()))
a={int(eval(input())) for i in range(m)}
dp=[-1]*(n+1)
print((func(n)%1000000007))
# Original solution
mod = 10**9+7
n, m = list(map(int, input().split()))
dp = [0]*(n+1)
dp[0] = 1
s = set()
for i in range(m):
    a = int(eval(input()))
    s.add(a)

for i in range(n):
    if i in s:
        continue
    for j in range(1,3):
        if i+j <= n:
            dp[i+j] = (dp[i+j] + dp[i])%mod

print((dp[-1]))

# Optimized solution
mod = 10**9+7
n, m = list(map(int, input().split()))
dp = [0]*(n+1)
dp[0] = 1
ok = [1]*(n+1)
for i in range(m):
    a = int(eval(input()))
    ok[a] = 0

for i in range(n):
    if not ok[i]:
        continue
    for j in range(1,3):
        if i+j <= n:
            dp[i+j] = (dp[i+j] + dp[i])%mod

print((dp[-1]))
# Original solution
N, M = list(map(int, input().split()))
A = list(int(eval(input())) for _ in range(M))
P = 10**9 + 7

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

# Optimized solution
N, M = list(map(int, input().split()))
if N == 1:
    print((1))
    quit()
if M > N//2:
    print((0))
    quit()

A = list(int(eval(input())) for _ in range(M))
idx = 0
P = 10**9 + 7

dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1
a = -1
if len(A):
    if 1 == A[idx]:
        dp[1] = 0
        if idx < M-1:
            idx += 1

if len(A):
    for i in range(2, N+1):
        if i != A[idx]:
            dp[i] = (dp[i-1] + dp[i-2]) % P
        else:
            dp[i] = 0
            if idx < M-1:
                idx += 1
else:
    for i in range(2, N+1):
        dp[i] = (dp[i-1] + dp[i-2]) % P
print((dp[N]))
# Original solution
import sys

input = sys.stdin.readline

n, m = list(map(int, input().split()))
mod = 10 ** 9 + 7
broken_steps = [False for _ in range(n)]

for _ in range(m):
    a = int(eval(input()))
    broken_steps[a - 1] = True

steps = [0 for _ in range(n + 1)]
steps[0] = 1

for i in range(n):
    if not broken_steps[i]:
        steps[i + 1] = (steps[i] + steps[i - 1]) % mod

print((steps[n]))


# Optimized solution
import sys

input = sys.stdin.readline

n, m = list(map(int, input().split()))
mod = 10 ** 9 + 7
broken_steps = [False for _ in range(n + 1)]

for _ in range(m):
    broken_steps[int(eval(input()))] = True

steps = [0 for _ in range(n + 1)]
steps[0] = 1

for now in range(n):
    next = now + 1
    if not broken_steps[next]:
        steps[next] = (steps[now] + steps[now - 1]) % mod

print((steps[n]))
# Original solution
import math
n, m = [int(i) for i in input().split()]
p = [int(eval(input())) for i in range(m)]
 
a = []
a.append(1)
if 1 in p:
    a.append(0)
else:
    a.append(1)
for i in range(2, n + 1):
    if i in p:
        a.append(0)
    else:
        a.append((a[i - 2] + a[i - 1]) % 1000000007)
    
print((a[n]))

# Optimized solution
import math
n, m = [int(i) for i in input().split()]
p = [0 for i in range(n + 1)]
for _ in range(m):
    p[int(eval(input()))] = 1
    
a = []
a.append(1)
if p[1] == 1:
    a.append(0)
else:
    a.append(1)
for i in range(2, n + 1):
    if p[i] == 1:
        a.append(0)
    else:
        a.append((a[i - 2] + a[i - 1]) % 1000000007)
    
print((a[n]))
# Original solution
n,m = list(map(int, input().split()))
l = [int(eval(input())) for i in range(m)]
ll = [0]*(n+2)
ll[1] = 1
for i in range(2,n+2):
    if not i-1 in l:
        ll[i] = ll[i-1] + ll[i - 2]
print((ll[-1] % 1000000007))


# Optimized solution
n,m = list(map(int, input().split()))
u = [0]*(n+1)
for i in range(m):
    u[int(eval(input()))] = 1
ll = [0]*(n+2)
ll[1] = 1
for i in range(2,n+2):
    if not u[i-1]:
        ll[i] = ll[i-1] + ll[i - 2]
print((ll[-1] % 1000000007))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
mod =  1000000007
ret = [0] * (N+1)
ret[0] = 1
for i in range(1,N+1):
    if i in a:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i-2] + ret[i-1]

print((ret[len(ret)-1]%mod))


# Optimized solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
mod =  1000000007
ret = [-1] * (N+1)
ret[0] = 1
for i in a:
    ret[i] = 0

for i in range(1,N+1):
    if ret[i] == 0:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i-2] + ret[i-1]

print((ret[len(ret)-1]%mod))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
mod =  1000000007
ret = [-1] * (N+1)
ret[0] = 1
for i in a:
    ret[i] = 0

for i in range(1,N+1):
    if ret[i] == 0:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i-2] + ret[i-1]

print((ret[len(ret)-1]%mod))


# Optimized solution
N, M = list(map(int, input().split()))
a = set([int(eval(input())) for _ in range(M)])
mod =  1000000007
ret = [0] * (N+1)
ret[0] = 1
for i in range(1,N+1):
    if i in a:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i-2] + ret[i-1]

print((ret[len(ret)-1]%mod))
# Original solution
I=lambda:list(map(int,input().split()))
n,m=I()
b=[int(eval(input())) for i in range(m)]
b=list(set(b))
f={}
for i in b:
    f[i]=1
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    if not f.get(i,0):
        dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
print((dp[n]))
    

# Optimized solution
def fib(n, broken):
    a = 1
    b = 1
    for i in range(n-2):
        # if i in broken:

        a, b = b, a + b
    print(b)


# t = int(input())
t = 1

for _ in range(t):
    n, m = [int(x) for x in input().split()]
    broken = set()
    for _ in range(m):
        broken.add(int(input()))

    x = 0
    y = 1
    i = 1
    impossible = False
    c = 0
    while i <= n:
        # print(f'degrau: {i}')
        # print(f'main loop: i: {i}')
        if i in broken:
            # print('broken')
            x = y
            if i + 1 in broken:
                impossible = True
                break
            while not ((i + 1) not in broken and (i + 2) not in broken and (i + 3) not in broken):

                if i + 1 in broken and i + 2 in broken:
                    impossible = True
                if i + 2 in broken and i + 3 in broken:
                    impossible = True

                i += 1
            i += 2
            # while True:
            #     print('entrei')

            #     if not ((i + 1) not in broken and (i + 2) not in broken and (i + 3) not in broken):
            #         print('aqui')

            #         i += 1
            #         print(f'i: {i}')
            #         break
            #     i += 3
            #     break

            #     c = 0
            #     for x in range(i + 1, i + 4):
            #         if x in broken:
            #             c += 1
            #     if c >= 2:
            #         impossible = True

            #     print(f'i: {i}')
            # if i + 1 not in broken and i + 2 not in broken and i + 3 not in broken:
            #     i += 1

            # print('broken')
            # x = y
            # # y = x
            # print(f'x: {x}, y: {y}')
            # previous_broken = False
            # while i not in broken and (i + 1) not in broken and (i + 2) not in broken:
            #     i += 1
            # while c < 2:
            #     i += 1
            #     if i in broken:
            #         if previous_broken:
            #             impossible = True
            #         previous_broken = True
            #         continue
            #     else:
            #         previous_broken = False
            #         c += 1
            # i += 2
            # c = 0
        else:
            y, x = (x + y) % 1000000007, y % 1000000007
            # print(f'x: {x}, y: {y}')
            c = 0
        i += 1
        # print(y)
    print(0) if impossible else print(y % 1000000007)
# Original solution
n,m=list(map(int,input().split()))
a=[int(eval(input())) for _ in range(m)]
dp=[0]*(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])%(10**9+7)
print((dp[n]))

# Optimized solution
n,m=list(map(int,input().split()))
a=set([int(eval(input())) for _ in range(m)])
dp=[0]*(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])%(10**9+7)
print((dp[n]))
# Original solution
N,M=list(map(int,input().split()))
A=[]
MOD=10**9+7
for _ in range(M):
    A.append(int(eval(input())))

a,b,n=0,1,1
while n<=N:
    if n in A:
        a,b=b,0
    else:
        a,b=b,a+b
    n+=1

print((b%MOD))

# Optimized solution
N,M=list(map(int,input().split()))
MOD=10**9+7
p,q,n=0,1,1
for _ in range(M):
    a=int(eval(input()))
    while n<=a:
        p,q=q,p+q
        n+=1
    q=0
while n<=N:
    p,q=q,p+q
    n+=1

print((q%MOD))
# Original solution
n, m = list(map(int, input().split()))
a = list(int(eval(input())) for i in  range(m))

p = 10**9+7
dp = [0]*(n+1)
dp[0] = 1

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



# Optimized solution
n, m = list(map(int, input().split()))
a = set(list(int(eval(input())) for i in  range(m)))

p = 10**9+7
dp = [0]*(n+1)
dp[0] = 1

for i in range(1, n+1):
    dp[i] = (dp[i-1] + dp[i-2])%p
    if i in a:
        dp[i] = 0
print((dp[n]))
# Original solution
import math
# input
stairs, broken = list(map(int, input().split()))
broken_list = []
for i in range(broken):
  broken_list.append(int(eval(input())))
  
# main
goalable = True
for i in range(1, broken):
  if broken_list[i-1] == broken_list[i]-1:
    goalable = False
    break

if goalable:
  broken_list.append(stairs+1)
  now = 0
  ans_list = []
  for b in broken_list:
    cp = b - 1
    stg = cp - now
    tmp = 0
    
    if stg != 0:
      for x in range(stg+1):
        if (stg - x) % 2 == 0:
          y = (stg - x) // 2
          tmp += math.factorial(x+y) // (math.factorial(x) * math.factorial(y))
      ans_list.append(tmp)
    else:
      ans_list.append(1)
    now = b + 1
  
  ans = 1
  for i in ans_list:
    ans = (i * ans) % 1000000007
  print(ans)
else:
  print((0))



# Optimized solution
# input
stairs, broken = list(map(int, input().split()))
conditions = [1] * (stairs + 1)
for i in range(broken):
  tmp = int(eval(input()))
  conditions[tmp] = 0
  
# main
for i in range(2, stairs+1):
  conditions[i] *= (conditions[i-1] + conditions[i-2]) % (10**9+7)

print((conditions[stairs]))