def fib(nn):
    if nn == 0:
        return 0
    aa, bb = 1, 1
    for ii in range(nn-1):
        aa, bb = bb, aa + bb
    return bb

n, m = map(int, input().split())
a = []
b = []
for i in range(m):
    a.append(int(input()))
if m == 0:
    pass
else:
    if a[0] == 1:
        b.append(1)
    else:
        b.append(a[0] - 1)
    for i in range(1, m):
        b.append(a[i] - a[i-1] - 1)
    b.append(n - a[len(a)-1] - 1)
c = []
for i in b:
    c.append(fib(i))

ans = 1
for i in c:
    ans *= i
    ans %= 1000000007
print(ans)


