#include <bits/stdc++.h>
using namespace std;
long long fib_memo[1000000] = {0};
long long fib(int n) {
  if (n == 0) return 0;
  if (n == 1) return 1;
  if (fib_memo[n] != 0) {
    return fib_memo[n];
  }
  return fib_memo[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  if (M == 0) {
    cout << fib(N) << endl;
    return 0;
  }
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i != 0 && (a[i - 1] == a[i] - 1)) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long ans = 1;
  for (int i = 0; i < M; i++) {
    if (i == 0)
      ans = fib(a[0]) % 1000000007;
    else
      ans = (ans * fib(a[i] - a[i - 1] - 1)) % 1000000007;
  }
  ans = (ans * fib(N - a[M - 1])) % 1000000007;
  cout << ans << endl;
  return 0;
}
