import sys

import numpy as np

MOD = 1000000007

def main():

    n, m = [int(x) for x in input().split()]

    pattern = [1]

    broken = -1

    brokencnt = 0

    if brokencnt < m:

        broken = int(eval(input()))

        brokencnt += 1

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

        if i == broken:

            pattern.append(0)

            if brokencnt < m:

                broken = int(eval(input()))

                brokencnt += 1

            continue

        if i == 1:

            pattern.append(pattern[i - 1])

        if i > 1:

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

    print((pattern[n]))

main()
# -*- coding: utf-8 -*-

"""

Created on Wed Jun 19 17:29:01 2019



@author: makigon

"""

mod = 10 ** 9 + 7

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

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



aset = set(a)

f = [0 for i in range(N)]

f[0] = 1

if 1 in a and N>=2 :

    f[1] = 0

elif 1 not in a and N>=2:

    f[1] = 1



for i in range(2,N):

    if i in aset:

        continue

    else:

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

    f[i] %= mod



if N == 1:

    print((f[N-1]))

else:       

    print(((f[N-1]+f[N-2]) % mod))

    

    

import sys
import numpy as np

MOD = 1000000007


def main():
    n, m = [int(x) for x in input().split()]
    pattern = [1]
    broken = -1
    brokencnt = 0
    if brokencnt < m:
        broken = int(eval(input()))
        brokencnt += 1
    for i in range(1, n + 1):
        if i == broken:
            pattern.append(0)
            if brokencnt < m:
                broken = int(eval(input()))
                brokencnt += 1
            continue
        if i == 1:
            pattern.append(pattern[i - 1])
        if i > 1:
            pattern.append((pattern[i - 1] + pattern[i - 2]) % MOD)
    print((pattern[n]))


main()

# -*- coding: utf-8 -*-
"""
Created on Wed Jun 19 17:29:01 2019
@author: makigon
"""
mod = 10**9 + 7
N, M = list(map(int, input().split()))
a = [int(eval(input())) for i in range(M)]
aset = set(a)
f = [0 for i in range(N)]
f[0] = 1
if 1 in a and N >= 2:
    f[1] = 0
elif 1 not in a and N >= 2:
    f[1] = 1
for i in range(2, N):
    if i in aset:
        continue
    else:
        f[i] = f[i - 1] + f[i - 2]
    f[i] %= mod
if N == 1:
    print((f[N - 1]))
else:
    print(((f[N - 1] + f[N - 2]) % mod))

-import sys -import numpy as np - -MOD = 1000000007 - - -def main(): -    n, m = [int(x) for x in input().split()] -    pattern = [1] -    broken = -1 -    brokencnt = 0 -    if brokencnt < m: -        broken = int(eval(input())) -        brokencnt += 1 -    for i in range(1, n + 1): -        if i == broken: -            pattern.append(0) -            if brokencnt < m: -                broken = int(eval(input())) -                brokencnt += 1 -            continue -        if i == 1: -            pattern.append(pattern[i - 1]) -        if i > 1: -            pattern.append((pattern[i - 1] + pattern[i - 2]) % MOD) -    print((pattern[n])) - - -main() +# -*- coding: utf-8 -*- +""" +Created on Wed Jun 19 17:29:01 2019 +@author: makigon +""" +mod = 10**9 + 7 +N, M = list(map(int, input().split())) +a = [int(eval(input())) for i in range(M)] +aset = set(a) +f = [0 for i in range(N)] +f[0] = 1 +if 1 in a and N >= 2: +    f[1] = 0 +elif 1 not in a and N >= 2: +    f[1] = 1 +for i in range(2, N): +    if i in aset: +        continue +    else: +        f[i] = f[i - 1] + f[i - 2] +    f[i] %= mod +if N == 1: +    print((f[N - 1])) +else: +    print(((f[N - 1] + f[N - 2]) % mod))