#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  long long m[100010], MOD = 1e9 + 7;
  cin >> N >> M;
  m[0] = 0;
  m[1] = 1;
  for (int i = 2; i <= N + 10; ++i) {
    m[i] = m[i - 1] + m[i - 2];
  }
  long long ans = 1, p = -1;
  for (int i = 0; i < M; ++i) {
    long long n;
    cin >> n;
    ans *= m[n - p - 1];
    ans %= MOD;
    p = n;
  }
  ans *= m[(N + 1) - p - 1];
  ans %= MOD;
  cout << ans << endl;
}
