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

N, M = map(int,input().split())
a = []
for i in range(M):
    a.append(int(input()))
result = 1
for i in range(M):
    if i == 0:
        result = Fib(a[i]+1) * result
    else:
        result = Fib(a[i]-a[i-1]) * result


result = result * Fib(N-a[M-1]+1)

print(result%1000000007)