def howmany(z):
    if z == -1 or z == 0 or z == 1:
        return(1)
    elif z == 2:
        return(2)
    else:
        return howmany(z-1) + howmany(z-2)

n,m = map(int,input().split())

x = 1
a = [0]*(m+2)
a[0] = -1
a[m+1] = n

for i in range(1,m+1):
    a[i] = int(input())

if m == 0:
    print(howmany(n))

elif all(a[i+1]-a[i] != 1 for i in range(1,m+1)):
    for i in range(1,m+1):
        x *= howmany(a[i] - a[i-1] -2)
    x *= howmany(a[m+1]-a[m]-1)
    print(x % 1000000007)

else: print(0)
    