N,M = map(int, input().split())
a = [int(input()) for i in range(M)]

def fib(n):
        a, b = 0, 1
        for i in range(n):
            a, b = b, a + b
        return b

if M == 0:
    print(fib(N))

flag = 0
if M >= 2:
    for i in range(M-1):
        if a[i+1] - a[i] == 1:
            flag += 1

if flag >= 1:
    print(0)


else:
    ans = fib(a[0]-1)
    for i in range(M-1):
        ans = (ans * fib(a[i+1]-a[i]-2))%(10**9+7)

    ans = (ans * fib(N-a[-1]-1))%(10**9+7)

    print(ans)