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]))

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]))

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]))

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]))

+import sys + +input = sys.stdin.readline -count = [-1 for i in range(n + 1)] +count = [-1] * (n + 1)