import sys
input = sys.stdin.readline
N, M = map(int,input().split())
hole = [0] * (N+1)
for i in range(M):
    hole[int(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
if hole[1] == 1:
    first = 0
    second = 1
    flg_one = True
elif hole[2] == 1:
    first = 1
    second = 0
    flg_two = True
else:
    first = 1
    second = 2

if flg_one and flg_two:
    print(0)
    exit()
flg = False

for i in range(3,N):
    if hole[i] == 1:
        if flg:
            print(0)
            exit()
        flg = True
        first = second
        second = 0
        flg = False
        continue
    tmp = first + second
    tmp %= 1000000007
    first = second
    second = tmp
    flg = False
tmp = first + second
tmp %= 1000000007
print(tmp)