import sys
input = sys.stdin.readline
N, M = map(int,input().split())
hole = [0] * M
for i in range(M):
    hole[i] = int(input())
if 1 in hole:
    first = 0
    second = 1
elif 2 in hole:
    first = 1
    second = 0
else:
    first = 1
    second = 2

if first == 0 and second == 0:
    print(0)
    exit()
flg = False

for i in range(3,N):
    if i in hole:
        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)