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

s = set(map(int, [eval(input()) for _ in range(m)]))

MOD = 10 ** 9 + 7

a = 1 if not 0 in s else 0

b = 1 if not 1 in s else 0

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

    if i in s:

        a, b = b, 0

    else:

        a, b = b, (a + b) % MOD

print(b)
import sys

input = sys.stdin.readline



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

s = set(map(int, [eval(input()) for _ in range(m)]))

MOD = 10 ** 9 + 7

a = 1 if not 0 in s else 0

b = 1 if not 1 in s else 0

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

    if i in s:

        a, b = b, 0

    else:

        a, b = b, (a + b) % MOD

print(b)
n, m = list(map(int, input().split()))
s = set(map(int, [eval(input()) for _ in range(m)]))
MOD = 10**9 + 7
a = 1 if not 0 in s else 0
b = 1 if not 1 in s else 0
for i in range(2, n + 1):
    if i in s:
        a, b = b, 0
    else:
        a, b = b, (a + b) % MOD
print(b)

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
s = set(map(int, [eval(input()) for _ in range(m)]))
MOD = 10**9 + 7
a = 1 if not 0 in s else 0
b = 1 if not 1 in s else 0
for i in range(2, n + 1):
    if i in s:
        a, b = b, 0
    else:
        a, b = b, (a + b) % MOD
print(b)

+import sys + +input = sys.stdin.readline