import sys
sys.setrecursionlimit(100001)

def intinput(): return map(int,sys.stdin.readline().split())

fibmemo={1:1,2:1}
for i in range(3,100000):
    fibmemo[i]=fibmemo[i-1]+fibmemo[i-2]
def fib(n):
    return fibmemo[n]

n,m=intinput()
mod=10**9+7
a=[int(sys.stdin.readline()) for _ in range(m)]
m=fib(a[0])
tmp=a[0]
for i in a:
    if i+1 in a:
        print(0)
        sys.exit()
    if a[0]==i:
        continue
    m=fib(i-tmp-1)*m%mod
    tmp=i
m=fib(n-tmp)*m%mod
print(m)