import sys

input = sys.stdin.readline

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

num = 10**9+7

nots = [int(eval(input())) for i in range(m)]

leng = len(nots)

cnt = 0

dp = [0]*(n+1)

dp[0] = 1

if leng > 0 and nots[0] == 1:

  dp[1] = 0

  nots.pop(0)

  leng -= 1

else:

  dp[1] = 1

if n == 1:

  print((1))

  exit()



for i in range(2,n+1):

  if leng > 0 and nots[cnt] == i:

    dp[i] = 0

    if cnt < leng - 1:

      cnt += 1

  else:

    dp[i] = (dp[i-1] + dp[i-2]) % num

print((dp[n] % num))
import sys

input = sys.stdin.readline

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

num = 10**9+7

nots = [int(eval(input())) for i in range(m)]

dp = [-1]*(n+1)

dp[0] = 1



for i in nots:

  dp[i] = 0



if dp[1] == -1:

  dp[1] = 1



if n == 1:

  print((1))

  exit()



for i in range(2,n+1):

  if dp[i] == -1:

    dp[i] = (dp[i-1] + dp[i-2]) % num

    

print((dp[n] % num))
import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
num = 10**9 + 7
nots = [int(eval(input())) for i in range(m)]
leng = len(nots)
cnt = 0
dp = [0] * (n + 1)
dp[0] = 1
if leng > 0 and nots[0] == 1:
    dp[1] = 0
    nots.pop(0)
    leng -= 1
else:
    dp[1] = 1
if n == 1:
    print((1))
    exit()
for i in range(2, n + 1):
    if leng > 0 and nots[cnt] == i:
        dp[i] = 0
        if cnt < leng - 1:
            cnt += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % num
print((dp[n] % num))

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
num = 10**9 + 7
nots = [int(eval(input())) for i in range(m)]
dp = [-1] * (n + 1)
dp[0] = 1
for i in nots:
    dp[i] = 0
if dp[1] == -1:
    dp[1] = 1
if n == 1:
    print((1))
    exit()
for i in range(2, n + 1):
    if dp[i] == -1:
        dp[i] = (dp[i - 1] + dp[i - 2]) % num
print((dp[n] % num))

-leng = len(nots) -cnt = 0 -dp = [0] * (n + 1) +dp = [-1] * (n + 1) -if leng > 0 and nots[0] == 1: -    dp[1] = 0 -    nots.pop(0) -    leng -= 1 -else: +for i in nots: +    dp[i] = 0 +if dp[1] == -1: -    if leng > 0 and nots[cnt] == i: -        dp[i] = 0 -        if cnt < leng - 1: -            cnt += 1 -    else: +    if dp[i] == -1: