n, m = map(int,input().split())
a = []
pam = -1

fibk={}
def fib(k):
    if k in fibk:
        return fibk[k]
    if k<0:
        return 0
    elif k==0 or k==1:
        return 1
    elif k-2 in fibk and not(k-1 in fibk):
        return fib(k-1)+fibk[k-2]
    elif k-2 in fibk and k-1 in fibk:
        return fibk[k-1]+fibk[k-2]
    else:
        return fib(k-1)+fib(k-2)


for i in range(0,m):
    am = int(input())
    a.append(am-pam)
    pam = am
a.append(n+1-pam)
count = 1
for aa in a:
    count = count * fib(aa-2)
print(count%(1000000007))