def Fib(n):
    a, b = 1, 2
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n - 2):
            a, b = b, a + b
        return b

now_step = 0
ans = 1
N, M = map(int, input().split(" "))
for i in range(M):
    a = int(input())
    if now_step == a:
        ans *= 0
        break
    elif now_step == (a - 1):
        now_step = a + 1
        continue
    else:
        ans *= Fib((a - 1) - now_step)
        now_step = a + 1
ans *= Fib(N - now_step)
print(ans % 1000000007)

