#include <bits/stdc++.h>
using namespace std;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
long long dp[110000];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (long long i = 0; i < m; i++) cin >> a[i];
  for (long long i = 0; i < m - 1; i++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  dp[0] = 1;
  int no = 0;
  for (long long i = 0; i < n; i++) {
    if (a[no] == i + 1) {
      dp[i + 2] += dp[i];
      dp[i + 2] %= MOD;
      no++;
      i++;
    } else {
      dp[i + 2] += dp[i];
      dp[i + 2] %= MOD;
      dp[i + 1] += dp[i];
      dp[i + 1] %= MOD;
    }
  }
  cout << dp[n] << endl;
}
