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[m+1] = n

a[1] = int(input())
x *= howmany(a[1]-1)

for i in range(2,m+1):
    a[i] = int(input())
    x *= howmany(a[i] - a[i-1] -2)

x *= howmany(a[m+1]-a[m] -1)

if  all(a[i+1]-a[i] != 1 for i in range(1,m+1)):
    print(x % 1000000007)
else: print(0)
    