import sys

sys.setrecursionlimit(10 ** 6)

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

dp = [0] * N
dp[1] = 1
dp[2] = 2


def fib(n):
    if n == 0:
        return 0
    elif dp[n] == 0:
        dp[n] = fib(n - 1) + fib(n - 2)
    return dp[n]


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