import sys, math, collections, heapq, itertools

def gcd(a, b):

    a, b = max(a, b), min(a, b)

    while a % b > 0: a, b = b, a % b

    return b

  

def solve():

    file = sys.stdin.readline #single: int(file()), line: map(int, file().split())

    INF = 10 ** 25

    mod = 7 + 10 ** 9

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

    broken = set()

    for i in range(M): broken |= {int(file())}



    DP = [0] * (N + 1)

    DP[0] = 1

    for i in range(N):

        if i + 1 not in broken: 

            DP[i+1] += DP[i]

            DP[i+1] %= mod

        if i + 2 <= N:

            if i + 2 not in broken:

                DP[i+2] += DP[i]

                DP[i+2] %= mod

    print((DP[N]))

    return 0

  

if __name__ == "__main__":

    solve()
import sys



def solve():

    input = sys.stdin.readline

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

    mod = 7 + 10 ** 9

    A = [True] * (N + 1)

    for _ in range(M):

        A[int(eval(input()))] = False

    DP = [0] * (N + 1)

    DP[0] = 1

    for i in range(N):

        if i < N - 1:

            if A[i + 2]: 

                DP[i + 2] += DP[i]

                DP[i + 2] %= mod

        if A[i + 1]:

            DP[i + 1] += DP[i]

            DP[i + 1] %= mod



    print((DP[N]))



    return 0



if __name__ == "__main__":

    solve()
import sys, math, collections, heapq, itertools


def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0:
        a, b = b, a % b
    return b


def solve():
    file = sys.stdin.readline  # single: int(file()), line: map(int, file().split())
    INF = 10**25
    mod = 7 + 10**9
    N, M = list(map(int, file().split()))
    broken = set()
    for i in range(M):
        broken |= {int(file())}
    DP = [0] * (N + 1)
    DP[0] = 1
    for i in range(N):
        if i + 1 not in broken:
            DP[i + 1] += DP[i]
            DP[i + 1] %= mod
        if i + 2 <= N:
            if i + 2 not in broken:
                DP[i + 2] += DP[i]
                DP[i + 2] %= mod
    print((DP[N]))
    return 0


if __name__ == "__main__":
    solve()

import sys


def solve():
    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    mod = 7 + 10**9
    A = [True] * (N + 1)
    for _ in range(M):
        A[int(eval(input()))] = False
    DP = [0] * (N + 1)
    DP[0] = 1
    for i in range(N):
        if i < N - 1:
            if A[i + 2]:
                DP[i + 2] += DP[i]
                DP[i + 2] %= mod
        if A[i + 1]:
            DP[i + 1] += DP[i]
            DP[i + 1] %= mod
    print((DP[N]))
    return 0


if __name__ == "__main__":
    solve()

-import sys, math, collections, heapq, itertools - - -def gcd(a, b): -    a, b = max(a, b), min(a, b) -    while a % b > 0: -        a, b = b, a % b -    return b +import sys -    file = sys.stdin.readline  # single: int(file()), line: map(int, file().split()) -    INF = 10**25 +    input = sys.stdin.readline +    N, M = list(map(int, input().split())) -    N, M = list(map(int, file().split())) -    broken = set() -    for i in range(M): -        broken |= {int(file())} +    A = [True] * (N + 1) +    for _ in range(M): +        A[int(eval(input()))] = False -        if i + 1 not in broken: +        if i < N - 1: +            if A[i + 2]: +                DP[i + 2] += DP[i] +                DP[i + 2] %= mod +        if A[i + 1]: -        if i + 2 <= N: -            if i + 2 not in broken: -                DP[i + 2] += DP[i] -                DP[i + 2] %= mod