MOD = 1000000007



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



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

for i in range(m):

    a[int(eval(input()))] = 1



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

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

    if a[i] == 1:

        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

MOD = 1000000007



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



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

nxt = 0



def scount(s,e):

    #print(s,e,file=sys.stderr)

    global count

    for i in range(s,e):

        if i == 0:

            count[i] = 1 

        elif i == 1:

            count[i] = 1

        else:

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



for i in range(m):

    a = int(eval(input()))

    if nxt == a:

        print((0))

        exit(0)

    scount(nxt,a)

    nxt = a+1



scount(nxt,n+1)



#print(count,file=sys.stderr)

print((count[n]))

MOD = 1000000007
n, m = list(map(int, input().split()))
a = [0 for i in range(n + 1)]
for i in range(m):
    a[int(eval(input()))] = 1
count = [0 for i in range(n + 1)]
for i in range(1, n + 1):
    if a[i] == 1:
        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

MOD = 1000000007
n, m = list(map(int, input().split()))
count = [0 for i in range(n + 1)]
nxt = 0


def scount(s, e):
    # print(s,e,file=sys.stderr)
    global count
    for i in range(s, e):
        if i == 0:
            count[i] = 1
        elif i == 1:
            count[i] = 1
        else:
            count[i] = (count[i - 1] + count[i - 2]) % MOD


for i in range(m):
    a = int(eval(input()))
    if nxt == a:
        print((0))
        exit(0)
    scount(nxt, a)
    nxt = a + 1
scount(nxt, n + 1)
# print(count,file=sys.stderr)
print((count[n]))

+import sys + -a = [0 for i in range(n + 1)] +count = [0 for i in range(n + 1)] +nxt = 0 + + +def scount(s, e): +    # print(s,e,file=sys.stderr) +    global count +    for i in range(s, e): +        if i == 0: +            count[i] = 1 +        elif i == 1: +            count[i] = 1 +        else: +            count[i] = (count[i - 1] + count[i - 2]) % MOD + + -    a[int(eval(input()))] = 1 -count = [0 for i in range(n + 1)] -for i in range(1, n + 1): -    if a[i] == 1: -        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 +    a = int(eval(input())) +    if nxt == a: +        print((0)) +        exit(0) +    scount(nxt, a) +    nxt = a + 1 +scount(nxt, n + 1) +# print(count,file=sys.stderr)