import sys

input = sys.stdin.readline

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

hole = [0] * (N+1)

for i in range(M):

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

if N == 1:

    print((1))

    exit()

if N == 2:

    if hole[1] == 1:

        print((1))

        exit()

    if hole[1] == 0:

        print((2))

        exit()

flg_one = False

flg_two = False

first = 1

second = 2

if hole[1] == 1:

    first = 0

    second = 1

    flg_one = True

if hole[2] == 1:

    first = 1

    second = 0

    flg_two = True

if flg_one and flg_two:

    print((0))

    exit()



for i in range(3,N):

    if hole[i] == 1:

        first = second

        second = 0

        continue

    tmp = first + second

    tmp %= 1000000007

    first = second

    second = tmp

tmp = first + second

tmp %= 1000000007

print(tmp)
MOD = 10**9 + 7

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

stairs = [0]*(N+1)

for _ in range(M):

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

if N == 1:

    print((1))

    exit()

ans = [0]*(N+1)

ans[1] = 1 if stairs[1] == 0 else 0

ans[2] = 1 + ans[1] if stairs[2] == 0 else 0

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

    if stairs[i] == 1:

        ans[i] = 0

        continue

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

print((ans[N]))
import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
hole = [0] * (N + 1)
for i in range(M):
    hole[int(eval(input()))] = 1
if N == 1:
    print((1))
    exit()
if N == 2:
    if hole[1] == 1:
        print((1))
        exit()
    if hole[1] == 0:
        print((2))
        exit()
flg_one = False
flg_two = False
first = 1
second = 2
if hole[1] == 1:
    first = 0
    second = 1
    flg_one = True
if hole[2] == 1:
    first = 1
    second = 0
    flg_two = True
if flg_one and flg_two:
    print((0))
    exit()
for i in range(3, N):
    if hole[i] == 1:
        first = second
        second = 0
        continue
    tmp = first + second
    tmp %= 1000000007
    first = second
    second = tmp
tmp = first + second
tmp %= 1000000007
print(tmp)

MOD = 10**9 + 7
N, M = list(map(int, input().split()))
stairs = [0] * (N + 1)
for _ in range(M):
    stairs[int(eval(input()))] = 1
if N == 1:
    print((1))
    exit()
ans = [0] * (N + 1)
ans[1] = 1 if stairs[1] == 0 else 0
ans[2] = 1 + ans[1] if stairs[2] == 0 else 0
for i in range(3, N + 1):
    if stairs[i] == 1:
        ans[i] = 0
        continue
    ans[i] = (ans[i - 1] + ans[i - 2]) % MOD
print((ans[N]))

-import sys - -input = sys.stdin.readline +MOD = 10**9 + 7 -hole = [0] * (N + 1) -for i in range(M): -    hole[int(eval(input()))] = 1 +stairs = [0] * (N + 1) +for _ in range(M): +    stairs[int(eval(input()))] = 1 -if N == 2: -    if hole[1] == 1: -        print((1)) -        exit() -    if hole[1] == 0: -        print((2)) -        exit() -flg_one = False -flg_two = False -first = 1 -second = 2 -if hole[1] == 1: -    first = 0 -    second = 1 -    flg_one = True -if hole[2] == 1: -    first = 1 -    second = 0 -    flg_two = True -if flg_one and flg_two: -    print((0)) -    exit() -for i in range(3, N): -    if hole[i] == 1: -        first = second -        second = 0 +ans = [0] * (N + 1) +ans[1] = 1 if stairs[1] == 0 else 0 +ans[2] = 1 + ans[1] if stairs[2] == 0 else 0 +for i in range(3, N + 1): +    if stairs[i] == 1: +        ans[i] = 0 -    tmp = first + second -    tmp %= 1000000007 -    first = second -    second = tmp -tmp = first + second -tmp %= 1000000007 -print(tmp) +    ans[i] = (ans[i - 1] + ans[i - 2]) % MOD +print((ans[N]))