import sys



n,m = list(map(int,input().split()))

t = [0] * 2

t[0] = 1

t[1] = 2

a = []

for _ in range(m):

	a.append(int(eval(input())))

mod = 10**9 + 7



for i in range(1,m):

	if a[i] - a[i-1] == 1:

		print((0))

		sys.exit()

a.append(n+1)



l = []

dan = 0

for i in range(m+1):

	l.append(a[i]-1-dan)

	dan = a[i] + 1

	if dan == n+2:

		break



if max(l) > 2:

	for i in range(2,max(l)):

		t.append(t[i-1] + t[i-2])



ans = 1

for i in l:

	if i != 0 and t[i-1] != 0:

		ans *= t[i-1]

		ans %= mod



print(ans)

import sys



n,m = list(map(int,input().split()))



a = []

for _ in range(m):

    a.append(int(eval(input())))



if n == 1:

    print((1))

    sys.exit()

dp = [0 for _ in range(n+1)]

dp[0] = 1

dp[1] = 1

dp[2] = 2

if m == 0:

    for i in range(2,n+1):

        dp[i] = dp[i-1] + dp[i-2]

    print((dp[n]%(10**9+7)))

else:

    c = 0

    for i in range(1,n+1):

        if i == a[c]:

            dp[i] = 0

            if c < m-1:

                c += 1

        else:

            dp[i] = dp[i-1] + dp[i-2]



    print((dp[n]%(10**9+7)))

import sys

n, m = list(map(int, input().split()))
t = [0] * 2
t[0] = 1
t[1] = 2
a = []
for _ in range(m):
    a.append(int(eval(input())))
mod = 10**9 + 7
for i in range(1, m):
    if a[i] - a[i - 1] == 1:
        print((0))
        sys.exit()
a.append(n + 1)
l = []
dan = 0
for i in range(m + 1):
    l.append(a[i] - 1 - dan)
    dan = a[i] + 1
    if dan == n + 2:
        break
if max(l) > 2:
    for i in range(2, max(l)):
        t.append(t[i - 1] + t[i - 2])
ans = 1
for i in l:
    if i != 0 and t[i - 1] != 0:
        ans *= t[i - 1]
        ans %= mod
print(ans)

import sys

n, m = list(map(int, input().split()))
a = []
for _ in range(m):
    a.append(int(eval(input())))
if n == 1:
    print((1))
    sys.exit()
dp = [0 for _ in range(n + 1)]
dp[0] = 1
dp[1] = 1
dp[2] = 2
if m == 0:
    for i in range(2, n + 1):
        dp[i] = dp[i - 1] + dp[i - 2]
    print((dp[n] % (10**9 + 7)))
else:
    c = 0
    for i in range(1, n + 1):
        if i == a[c]:
            dp[i] = 0
            if c < m - 1:
                c += 1
        else:
            dp[i] = dp[i - 1] + dp[i - 2]
    print((dp[n] % (10**9 + 7)))

-t = [0] * 2 -t[0] = 1 -t[1] = 2 -mod = 10**9 + 7 -for i in range(1, m): -    if a[i] - a[i - 1] == 1: -        print((0)) -        sys.exit() -a.append(n + 1) -l = [] -dan = 0 -for i in range(m + 1): -    l.append(a[i] - 1 - dan) -    dan = a[i] + 1 -    if dan == n + 2: -        break -if max(l) > 2: -    for i in range(2, max(l)): -        t.append(t[i - 1] + t[i - 2]) -ans = 1 -for i in l: -    if i != 0 and t[i - 1] != 0: -        ans *= t[i - 1] -        ans %= mod -print(ans) +if n == 1: +    print((1)) +    sys.exit() +dp = [0 for _ in range(n + 1)] +dp[0] = 1 +dp[1] = 1 +dp[2] = 2 +if m == 0: +    for i in range(2, n + 1): +        dp[i] = dp[i - 1] + dp[i - 2] +    print((dp[n] % (10**9 + 7))) +else: +    c = 0 +    for i in range(1, n + 1): +        if i == a[c]: +            dp[i] = 0 +            if c < m - 1: +                c += 1 +        else: +            dp[i] = dp[i - 1] + dp[i - 2] +    print((dp[n] % (10**9 + 7)))