law = 10 ** 9 + 7

fibo_memo = {}
def fibo(N):
    if (N <= 3):
        return N

    if (N in fibo_memo):
        return fibo_memo[N]

    val = fibo(N - 1) + fibo(N - 2)
    fibo_memo[N] = val
    return val

def main():
    N, M = map(int, input().split())

    ans = 1
    b = 0
    for _ in range(M):
        a = int(input())

        if (a > 1):
            ans = ans * fibo(a - b - 1) % law
        b = a

    ans = ans * fibo(N - b - 1) % law

    return ans


if __name__ == "__main__":
    print(main())
        
