#import sys

#from collections import deque

#from collections import defaultdict

#import math

#sys.setrecursionlimit(20000000)

#input = sys.stdin.readline

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

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

a = set(a)

mod = 10**9+7

dp = [0]*(n+1)

dp[0] = 1

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

        if i in a:

                continue

        if i == 1:

                dp[i] = 1

                continue

        dp[i] = dp[i-1] + dp[i-2]

        dp[i] %= mod

print((dp[n]%mod))
import sys

from collections import deque

from collections import defaultdict

import math

sys.setrecursionlimit(20000000)

input = sys.stdin.readline

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

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

a = set(a)

mod = 10**9+7

dp = [0]*(n+5)

dp[0] = 1

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

        if i in a:

                continue

        dp[i] = dp[i-1] + dp[i-2]

        dp[i] %= mod

print((dp[n]%mod))

# import sys
# from collections import deque
# from collections import defaultdict
# import math
# sys.setrecursionlimit(20000000)
# input = sys.stdin.readline
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
    if i in a:
        continue
    if i == 1:
        dp[i] = 1
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= mod
print((dp[n] % mod))

import sys
from collections import deque
from collections import defaultdict
import math

sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9 + 7
dp = [0] * (n + 5)
dp[0] = 1
for i in range(1, n + 1):
    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= mod
print((dp[n] % mod))

-# import sys -# from collections import deque -# from collections import defaultdict -# import math -# sys.setrecursionlimit(20000000) -# input = sys.stdin.readline +import sys +from collections import deque +from collections import defaultdict +import math + +sys.setrecursionlimit(20000000) +input = sys.stdin.readline -dp = [0] * (n + 1) +dp = [0] * (n + 5) -    if i == 1: -        dp[i] = 1 -        continue