#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long dp[100010];
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  if (M >= 2) {
    for (int i = 1; i < M; i++) {
      if (a[i] - a[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  long long ans = 1;
  for (int i = 1; i <= N; i++) {
    if (i <= 2) {
      dp[i] = (dp[i - 1] + 1) % mod;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    }
  }
  int left = 0;
  for (int i = 0; i < M; i++) {
    if (a[i] - 1 - left < 0) continue;
    long long temp = dp[a[i] - 1 - left];
    if (temp == 0) {
      ans *= 1;
    } else {
      ans = (ans * temp) % mod;
    }
    left = a[i] + 1;
  }
  ans = (ans * dp[N - left]) % mod;
  cout << ans << endl;
}
