n,m = map(int,input().split())
a = []
a.append(0)
for i in range(m):
    b = int(input())
    b -= 1
    a.append(b)
a.append(n)
b = []
b.append(1)
b.append(2)

for i in range(n-2):
    c =b[i]
    d = b[i+1]
    e = c + d
    b.append(e)

c = []
c.append(b[a[1] - a[0]  - 1])
i = 1
while i <= m:
    if a[i + 1] - a[i] > 1:
        c.append(b[a[i + 1] - a[i]  - 3])
        i += 1
    else:
        c.append(0)
        break
#print(c)
d = c[0] 
i = 1
#print(d)
while i < len(c):
    d = d * c[i]
    i += 1
print(d % 1000000007)

