    
def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b
    
N,M = map(int,input().split())

broken = [1]+[0]*(M+1)
for i in range(M):
    broken[i+1] = int(input())
broken[-1] = N-1

step = [broken[i+1]-broken[i] for i in range(M+1)]

if 1 in step[1:-1]:
    print('0')
else:
    ans = 1
    for s in step:
        a = Fib(s+2)
#        print(a)
        ans *= a
    print(str(ans%1000000007))