import functools
import operator

def fib(n):
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    return int(f)

N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
if A[0] == 1:
    A.pop(0)
    A.insert(0, 2)
    A.append(N)
    sabun = [A[i+1]-A[i] for i in range(M)]
else:
    A.insert(0, 0)
    A.append(N)
    sabun = [A[i+1]-A[i] for i in range(M+1)]
# print(sabun)
if min(sabun) == 0:
    print("0")
else:
    ans = [fib(i) for i in sabun]
    # print(ans)
    result = functools.reduce(operator.mul, ans)
    print(int(result%1000000007))