# -*- coding: utf-8 -*-
# c ABC129
# input


def endFib(n, a1=1, a2=0):
    if n < 1:
        return a1
    else:
        return endFib(n-1, a1 + a2, a1)


n, m = map(int, input().split())
mod = 10**9+7
o = 1
p = 0
if m == 0:
    if n < 3:
        o = n % mod
    else:
        o = endFib(n) % mod

elif m > 0:
    ft = int(input())
    if ft < 3:
        p = ft
    elif ft == 3:
        o = 2 % mod
        p = ft
    elif ft > 3:
        o = endFib(ft-1) % mod
        p = ft
    else:
        p = ft

    for i in range(m-1):
        t = int(input())
        if t-1-p == 0:
            print(0)
            exit()
        elif t-1-p == 1:
            p = t
        elif t-1-p == 2:
            p = t
        elif t-1-p == 3:
            o = (o * 2) % mod
            p = t
        elif t-1-p > 3:
            o = (o * endFib(t-2-p)) % mod
            p = t
        else:
            pass
    if n-p > 3:
        o = (o * endFib(n-p-1)) % mod
    elif n-p == 3:
        o = (o * 2) % mod
    else:
        pass

print(int(o))