def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

from itertools import permutations
from math import factorial, hypot

#############
# Main Code #
#############

N, M = getNM()
A = set(getArray(M))
print(A)

dp = [0] * (N + 1)
dp[0] = 1

for i in range(1, N + 1):
    if not i in A:
        if i == 1:
            dp[i] = dp[i - 1] % mod
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print(dp[N] % mod)