#!/usr/bin/env python3

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, input().split())
A = set()
MOD = 10**9 + 7

for i in range(M):
    a = int(input())
    A.add(a)

seen = {}


def count(N, pos):
    # 一番上までたどり着いた時
    if N == 0:
        return 1

    # 再起
    res = 0
    if pos + 1 not in A:
        try:
            res += seen[N-1]
        except:
            way = count(N-1, pos+1) % MOD
            seen[N-1] = way
            res += way
        res %= MOD

    if pos + 2 not in A and N-2 >= 0:
        try:
            res += seen[N-2]
        except:
            way = count(N-2, pos+2) % MOD
            seen[N-2] = way
            res += way
        res %= MOD
    return res % MOD


print(count(N, 0))

