import sys

input = sys.stdin.readline



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

broken = set([int(eval(input())) for _ in range(m)]) # ここが'list'だとPypyでも通らない



def ptn_num(x): # 'x'stepまでのパターン数

    dp = [0] * (x+1) # DP枠_including step'0'

    if 1 in broken: # in case, step'1' broken 

        dp[:2] = 1, 0

    else:

        dp[:2] = 1, 1 # Usually



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

        if i not in broken: # 階段が壊れてない場合...

            dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7) # -1段目と-2段目の合計

    print((dp[-1]))



ptn_num(n)

import sys

input = sys.stdin.readline



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

broken = set([int(eval(input())) for _ in range(m)]) # ここが'list'だとPypyでも通らない



def ptn_num(x): # 'x'stepまでのパターン数

    dp = [0] * (x+1) # DP枠_including step'0'

    if 1 in broken: # 固定部分_in case, step'1' broken 

        dp[:2] = 1, 0

    else:

        dp[:2] = 1, 1 # 固定部分_Usually



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

        if i not in broken: # 階段が壊れてない場合...

            dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7) # -1段目と-2段目の合計

    print((dp[-1]))



ptn_num(n)
import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
broken = set([int(eval(input())) for _ in range(m)])  # ここが'list'だとPypyでも通らない


def ptn_num(x):  # 'x'stepまでのパターン数
    dp = [0] * (x + 1)  # DP枠_including step'0'
    if 1 in broken:  # in case, step'1' broken
        dp[:2] = 1, 0
    else:
        dp[:2] = 1, 1  # Usually
    for i in range(2, x + 1):
        if i not in broken:  # 階段が壊れてない場合...
            dp[i] = (dp[i - 1] + dp[i - 2]) % (10**9 + 7)  # -1段目と-2段目の合計
    print((dp[-1]))


ptn_num(n)

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
broken = set([int(eval(input())) for _ in range(m)])  # ここが'list'だとPypyでも通らない


def ptn_num(x):  # 'x'stepまでのパターン数
    dp = [0] * (x + 1)  # DP枠_including step'0'
    if 1 in broken:  # 固定部分_in case, step'1' broken
        dp[:2] = 1, 0
    else:
        dp[:2] = 1, 1  # 固定部分_Usually
    for i in range(2, x + 1):
        if i not in broken:  # 階段が壊れてない場合...
            dp[i] = (dp[i - 1] + dp[i - 2]) % (10**9 + 7)  # -1段目と-2段目の合計
    print((dp[-1]))


ptn_num(n)

-    if 1 in broken:  # in case, step'1' broken +    if 1 in broken:  # 固定部分_in case, step'1' broken -        dp[:2] = 1, 1  # Usually +        dp[:2] = 1, 1  # 固定部分_Usually