#!/usr/bin/python3

# -*- coding: utf-8 -*-





MOD = 1000000007





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

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

for _ in range(M):

  dp[int(eval(input()))] = 0



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

  if dp[i] > 0:

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

print((dp[-1]))
#!/usr/bin/python3

# -*- coding: utf-8 -*-

from collections import deque





MOD = 1000000007 





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

An = [int(eval(input())) for _ in range(M)]



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

for a in An:

  dp[a] = 0





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

  if dp[i] > 0:

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

print((dp[N]))
#!/usr/bin/python3
# -*- coding: utf-8 -*-
MOD = 1000000007
N, M = list(map(int, input().split()))
dp = [1 for _ in range(N + 1)]
for _ in range(M):
    dp[int(eval(input()))] = 0
for i in range(2, N + 1):
    if dp[i] > 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
print((dp[-1]))

#!/usr/bin/python3
# -*- coding: utf-8 -*-
from collections import deque

MOD = 1000000007
N, M = list(map(int, input().split()))
An = [int(eval(input())) for _ in range(M)]
dp = [1 for _ in range(N + 1)]
for a in An:
    dp[a] = 0
for i in range(2, N + 1):
    if dp[i] > 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
print((dp[N]))

+from collections import deque + +An = [int(eval(input())) for _ in range(M)] -for _ in range(M): -    dp[int(eval(input()))] = 0 +for a in An: +    dp[a] = 0 -print((dp[-1])) +print((dp[N]))