#N = int(input())

N, M =  list(map(int,input().split()))

#W =list(map(int,input().split()))

a = [(int(eval(input()))) for i in range(M)]



import sys



sys.setrecursionlimit(100000)

memo  =[-1]*(N+2)

def stair_count(n):

    if memo[n]!= -1:

        return memo[n]

    if n==0 or n==1:

        memo[n] =1

        return memo[n]

    memo[n] = stair_count(n-1) + stair_count(n-2)

    return memo[n]



start = 0

answer = 1

for i in a:

        if i == start:

            print((0))

            exit()

        else:

            n = i-1-start

            answer = (answer * stair_count(n))

            start = i+1

n = N -start

answer = (answer * stair_count(n))

print((answer%1000000007))

#N = int(input())

N, M =  list(map(int,input().split()))

#W =list(map(int,input().split()))

a = [(int(eval(input()))) for i in range(M)]



import sys

sys.setrecursionlimit(100000)



memo  =[-1]*(N+2)

memo[0] = 1

memo[1] = 1

def stair_count(n):

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

        memo[j] = memo[j-1] + memo[j-2]



start = 0

answer = 1

dif = []

for i in a:

    if i == start:

        print((0))

        exit()

    else:

        n = i-1-start

        dif.append(n)

        start = i+1

dif.append(N-start)

stair_count(max(dif))

for i in dif:

        answer = (answer * memo[i])



print((answer%1000000007))

# N = int(input())
N, M = list(map(int, input().split()))
# W =list(map(int,input().split()))
a = [(int(eval(input()))) for i in range(M)]
import sys

sys.setrecursionlimit(100000)
memo = [-1] * (N + 2)


def stair_count(n):
    if memo[n] != -1:
        return memo[n]
    if n == 0 or n == 1:
        memo[n] = 1
        return memo[n]
    memo[n] = stair_count(n - 1) + stair_count(n - 2)
    return memo[n]


start = 0
answer = 1
for i in a:
    if i == start:
        print((0))
        exit()
    else:
        n = i - 1 - start
        answer = answer * stair_count(n)
        start = i + 1
n = N - start
answer = answer * stair_count(n)
print((answer % 1000000007))

# N = int(input())
N, M = list(map(int, input().split()))
# W =list(map(int,input().split()))
a = [(int(eval(input()))) for i in range(M)]
import sys

sys.setrecursionlimit(100000)
memo = [-1] * (N + 2)
memo[0] = 1
memo[1] = 1


def stair_count(n):
    for j in range(2, n + 1):
        memo[j] = memo[j - 1] + memo[j - 2]


start = 0
answer = 1
dif = []
for i in a:
    if i == start:
        print((0))
        exit()
    else:
        n = i - 1 - start
        dif.append(n)
        start = i + 1
dif.append(N - start)
stair_count(max(dif))
for i in dif:
    answer = answer * memo[i]
print((answer % 1000000007))

+memo[0] = 1 +memo[1] = 1 -    if memo[n] != -1: -        return memo[n] -    if n == 0 or n == 1: -        memo[n] = 1 -        return memo[n] -    memo[n] = stair_count(n - 1) + stair_count(n - 2) -    return memo[n] +    for j in range(2, n + 1): +        memo[j] = memo[j - 1] + memo[j - 2] +dif = [] -        answer = answer * stair_count(n) +        dif.append(n) -n = N - start -answer = answer * stair_count(n) +dif.append(N - start) +stair_count(max(dif)) +for i in dif: +    answer = answer * memo[i]