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

fib = []
for i in range(N):
    if i in (0,1):
        fib.append(1)
    else:
        fib.append(fib[i-2] + fib[i-1])

ans = 1
for i in range(1, M+2):
    if (a[i] - a[i-1] == 1) and (a[i] != 1) and (a[i-1] != N-1):
        print(0)
        break
    else:
        ans *= fib[a[i]-a[i-1]-1]
else:
    print(ans % 1000000007)