#!/usr/bin/env python
import sys
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]
m = 10**9+7
def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

for i, a in enumerate(A[:-1]):
    if a+1 == A[i+1]:
        print(0)
        sys.exit()
ans = 1
s = 0
for i in range(N):
    if i in A:
        ans *= Fib(i-s+1)
        ans %= m
        s = i+1
ans *= Fib(N-s+2)
ans %= m 
print(ans)