N, M = map(int, input().split())
F = [1]+[2]+[0]*100000

for i in range(2, 100002):
    F[i] = F[i-1] + F[i-2]

ans = 1
cur = 0
pre = 0
for i in range(M):
    broken = int(input())
    if pre == broken:
        continue
    pre = broken
    if cur == broken:
        print(0)
        break
    elif broken - cur == 1:
        cur = broken + 1
    else:
        ans *= F[broken - cur - 2]
        ans %= 1000000007
        cur = broken + 1
else:
    ans *= F[N - cur - 1]
    print(ans % 1000000007)

