#!/usr/bin/env pypy
from __future__ import division, print_function

import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase

import __pypy__


MOD = 10**9 + 7

def main():
    N, M = read_int_array()
    nums = []
    for _ in range(M):
        nums.append(read_int())
    print(solve(N, nums))


def solve(N, nums):
    dp = [0] * (N + 1)
    dp[0] = 1
    broken = set(nums)
    for i in range(1, N + 1):
        if i in broken:
            dp[i] = 0
            continue
        dp[i] = dp[i - 1]
        if i > 1:
            dp[i] = (dp[i] + dp[i - 2]) % MOD
    return dp[N]


import math
import random


def always_true(*args, **kwargs):
    return True


def generate_nums(n, min, max, check_if_good=always_true):
    while True:
        numSet = set()
        nums = []
        for _ in range(n):
            while True:
                x = random.randint(min, max)
                if x not in numSet:
                    numSet.add(x)
                    nums.append(x)
                    break
        if check_if_good(nums):
            return nums


def main2():
    for _ in range(1000000):
        N = random.randint(1, 10**5)
        M = random.randint(0, min(3, N-1))
        nums = generate_nums(M, 1, N-1, lambda nums: len(nums) == len(set(nums)))
        print(solve(N, nums), flush=True)


# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

read = input
read_int = lambda: int(input())
read_array = lambda sep=None, maxsplit=-1: input().split(sep, maxsplit)
read_int_array = lambda: [int(a) for a in read_array()]

# endregion

if __name__ == "__main__":
    main()


Measured memory_bytes: 52572