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

mod = 1000000007
N, M = map(int, input().strip().split())
a = [int(input()) for _ in range(M)]
a.append(N+1)

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

res = 1
prev_a = -1
for cur_a in a:
    if  cur_a - prev_a == 1:
        res = 0
        break
    res *= fibonacci(cur_a - prev_a - 1) % mod
    res %= mod
    prev_a = cur_a
    continue

print(res)
