#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc129_c

N, M = map(int, input().strip().split())
a = [int(input()) for _ in range(M)]

def fibonacci(x):
    if x > 2:
        return fibonacci(x-1) + fibonacci(x-2)
    else:
        return 1

res = 1
count = 0
for i in range(N+1):
    if i in a:
        if count == 0:
            res = 0
            break
        res *= fibonacci(count)
        res %= 1000000007
        count = 0
        continue
    count += 1

if res != 0:
    res *= fibonacci(count)
    res %= 1000000007

print(res)
