#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  return f(n - 1) + f(n - 2);
}
signed main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M + 2);
  a[0] = -1;
  for (long long i = 0; i < (long long)(M); i++) cin >> a[i + 1];
  a[M + 1] = N + 1;
  long long ans = 1;
  for (long long i = 0; i < (long long)(M + 1); i++) {
    if (a[i] + 1 == a[i + 1]) {
      ans = 0;
      break;
    }
    long long d = a[i + 1] - a[i] - 2;
    ans = (ans * f(d)) % 1000000007;
  }
  cout << ans % 1000000007 << endl;
}
