n = list(map(int, input().split()))
s = [int(input()) for i in range(n[1])]
s.append(n[0]+1)

def stairs(x):
    if x > 2:
        return stairs(x-1) + stairs(x-2)
    elif x == 2:
        return 2
    elif x == 1 or x == 0:
        return 1

sa = [s[0]-1]
for i in range(n[1]):
    sa.append((s[i+1]-1) - (s[i]+1))
ans = 1
for k in range(len(sa)):
    ans *= stairs(sa[k])

print(ans%1000000007)
