import numpy as np

from collections import defaultdict

from functools import reduce



MOD = 1000000007



A = set()



# s = input()

# n = int(input())

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

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



for _ in range(m):

    a = int(eval(input()))

    A.add(a)



res = [0]*(n+1)



res[0] = 1

if 1 not in A:

    res[1] = 1



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

    if i in A:

        continue

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



print((res[n]))







class Interval():

    def __init__(self, li):

        self.li = li

        self.n = len(li)

        self.sum_li = [li[0]]

        for i in range(1, self.n):

            self.sum_li.append(self.sum_li[i-1] + li[i])



    def sum(self, a, b=None):

        if b is None:

            return self.sum(0, a)



        res = self.sum_li[min(self.n-1, b-1)]

        if a > 0:

            res -= self.sum_li[a-1]

        return res



MOD = 1000000007



A = set()



# s = input()

# n = int(input())

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

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



for _ in range(m):

    a = int(eval(input()))

    A.add(a)



res = [0]*(n+1)



res[0] = 1

if 1 not in A:

    res[1] = 1



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

    if i in A:

        continue

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



print((res[n]))

import numpy as np
from collections import defaultdict
from functools import reduce

MOD = 1000000007
A = set()
# s = input()
# n = int(input())
# A = list(map(int, input().split()))
n, m = list(map(int, input().split()))
for _ in range(m):
    a = int(eval(input()))
    A.add(a)
res = [0] * (n + 1)
res[0] = 1
if 1 not in A:
    res[1] = 1
for i in range(2, n + 1):
    if i in A:
        continue
    res[i] = (res[i - 1] + res[i - 2]) % MOD
print((res[n]))


class Interval:
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i - 1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)
        res = self.sum_li[min(self.n - 1, b - 1)]
        if a > 0:
            res -= self.sum_li[a - 1]
        return res

MOD = 1000000007
A = set()
# s = input()
# n = int(input())
# A = list(map(int, input().split()))
n, m = list(map(int, input().split()))
for _ in range(m):
    a = int(eval(input()))
    A.add(a)
res = [0] * (n + 1)
res[0] = 1
if 1 not in A:
    res[1] = 1
for i in range(2, n + 1):
    if i in A:
        continue
    res[i] = (res[i - 1] + res[i - 2]) % MOD
print((res[n]))

-import numpy as np -from collections import defaultdict -from functools import reduce - - - -class Interval: -    def __init__(self, li): -        self.li = li -        self.n = len(li) -        self.sum_li = [li[0]] -        for i in range(1, self.n): -            self.sum_li.append(self.sum_li[i - 1] + li[i]) - -    def sum(self, a, b=None): -        if b is None: -            return self.sum(0, a) -        res = self.sum_li[min(self.n - 1, b - 1)] -        if a > 0: -            res -= self.sum_li[a - 1] -        return res