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

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

a.sort()

a.append(10 ** 9 + 7)

a.append(10 ** 9 + 7)



memo = [0] * (N + 1)

memo[0] = 1



idx = 0

for pos in range(1, N + 1):

    if a[idx] == pos:

        memo[pos] = 0

        for i in range(idx, N):

            if a[i] > pos: break

        idx = i

        continue

    else:

        if pos > a[idx]:

            for i in range(idx, N):

                if a[i] > pos: break

            idx = i

        #

        if pos == 1:

            memo[1] = (memo[0]) % (10 ** 9 + 7)

        else:

            memo[pos] = (memo[pos - 2] + memo[pos - 1]) % (10 ** 9 + 7)



# print("#", memo)

print((memo[-1]))
# -*- coding: utf-8 -*-

MOD = 1000000007

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

a = []

for _ in range(M):

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





def getPatternNum(num):

    pattern = [0] * (num + 2)

    pattern[0] = 0

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

        if i == 0 or i == 1:

            pattern[i] = 1

            continue

        pattern[i] = (pattern[i - 2] + pattern[i - 1]) % MOD

    return pattern



def solve():

    # 階段の連続してる数のリスト

    stepsList = [0] * (M + 1)

    maxSteps = 0

    if M > 0:

        stepsList[0] = a[0]

        for j in range(1, M):

            stepsList[j] = a[j] - a[j - 1] - 1

            if stepsList[j] == 0:

                return 0

        stepsList[M] = N - a[M - 1]

    else:

        stepsList = [N + 1]

    pattern = getPatternNum(max(stepsList) + 1)

    # こわれてるところ以外のパターンを掛ける

    # print("#", pattern)

    for k in range(len(stepsList)):

        if k == 0:

            total = pattern[stepsList[k]]

        else:

            total = (total * pattern[stepsList[k]]) % MOD

        # print("##", k, stepsList[k], pattern[stepsList[k]], total)



    return total





ans = solve()

print(ans)
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
a.sort()
a.append(10**9 + 7)
a.append(10**9 + 7)
memo = [0] * (N + 1)
memo[0] = 1
idx = 0
for pos in range(1, N + 1):
    if a[idx] == pos:
        memo[pos] = 0
        for i in range(idx, N):
            if a[i] > pos:
                break
        idx = i
        continue
    else:
        if pos > a[idx]:
            for i in range(idx, N):
                if a[i] > pos:
                    break
            idx = i
        #
        if pos == 1:
            memo[1] = (memo[0]) % (10**9 + 7)
        else:
            memo[pos] = (memo[pos - 2] + memo[pos - 1]) % (10**9 + 7)
# print("#", memo)
print((memo[-1]))

# -*- coding: utf-8 -*-
MOD = 1000000007
N, M = list(map(int, input().split()))
a = []
for _ in range(M):
    a.append(int(eval(input())))


def getPatternNum(num):
    pattern = [0] * (num + 2)
    pattern[0] = 0
    for i in range(1, num + 2):
        if i == 0 or i == 1:
            pattern[i] = 1
            continue
        pattern[i] = (pattern[i - 2] + pattern[i - 1]) % MOD
    return pattern


def solve():
    # 階段の連続してる数のリスト
    stepsList = [0] * (M + 1)
    maxSteps = 0
    if M > 0:
        stepsList[0] = a[0]
        for j in range(1, M):
            stepsList[j] = a[j] - a[j - 1] - 1
            if stepsList[j] == 0:
                return 0
        stepsList[M] = N - a[M - 1]
    else:
        stepsList = [N + 1]
    pattern = getPatternNum(max(stepsList) + 1)
    # こわれてるところ以外のパターンを掛ける
    # print("#", pattern)
    for k in range(len(stepsList)):
        if k == 0:
            total = pattern[stepsList[k]]
        else:
            total = (total * pattern[stepsList[k]]) % MOD
        # print("##", k, stepsList[k], pattern[stepsList[k]], total)
    return total


ans = solve()
print(ans)

+# -*- coding: utf-8 -*- +MOD = 1000000007 -a = [int(eval(input())) for _ in range(M)] -a.sort() -a.append(10**9 + 7) -a.append(10**9 + 7) -memo = [0] * (N + 1) -memo[0] = 1 -idx = 0 -for pos in range(1, N + 1): -    if a[idx] == pos: -        memo[pos] = 0 -        for i in range(idx, N): -            if a[i] > pos: -                break -        idx = i -        continue +a = [] +for _ in range(M): +    a.append(int(eval(input()))) + + +def getPatternNum(num): +    pattern = [0] * (num + 2) +    pattern[0] = 0 +    for i in range(1, num + 2): +        if i == 0 or i == 1: +            pattern[i] = 1 +            continue +        pattern[i] = (pattern[i - 2] + pattern[i - 1]) % MOD +    return pattern + + +def solve(): +    # 階段の連続してる数のリスト +    stepsList = [0] * (M + 1) +    maxSteps = 0 +    if M > 0: +        stepsList[0] = a[0] +        for j in range(1, M): +            stepsList[j] = a[j] - a[j - 1] - 1 +            if stepsList[j] == 0: +                return 0 +        stepsList[M] = N - a[M - 1] -        if pos > a[idx]: -            for i in range(idx, N): -                if a[i] > pos: -                    break -            idx = i -        # -        if pos == 1: -            memo[1] = (memo[0]) % (10**9 + 7) +        stepsList = [N + 1] +    pattern = getPatternNum(max(stepsList) + 1) +    # こわれてるところ以外のパターンを掛ける +    # print("#", pattern) +    for k in range(len(stepsList)): +        if k == 0: +            total = pattern[stepsList[k]] -            memo[pos] = (memo[pos - 2] + memo[pos - 1]) % (10**9 + 7) -# print("#", memo) -print((memo[-1])) +            total = (total * pattern[stepsList[k]]) % MOD +        # print("##", k, stepsList[k], pattern[stepsList[k]], total) +    return total + + +ans = solve() +print(ans)