from collections import deque

N, M = map(int, input().split())  # N…段数、M…壊れてる床
crashstep = [int(input()) for i in range(M)]

waru = 1000000007

# 階段マッピング
step = []
for i in range(N):
    if i in crashstep:
        step.append(1)
    else:
        step.append(0)

#print(step)

# 階段探索
stack = deque()
# for j in range(N):
cnt = 0
end = False
nodes = 0

while end == False:
    # １歩でも２歩でも登れる段は分岐するのでスタックに保存
    if cnt + 2 < N and step[cnt + 1] == 1 and step[cnt + 2] == 1:
        print("0")
        quit()

    if cnt + 2 < N and step[cnt + 1] == 0 and step[cnt + 2] == 0:
        stack.append(cnt)
        # print(cnt)

    if cnt == N:
        nodes += 1
        if len(stack) > 0:
            cnt = stack.pop()
        else:
            end = True

    cnt += 1
    # print(cnt)

print(nodes % waru)