#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
const long long INF = 1LL << 60;
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;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m + 1, 0);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<long long> dp(n + 1, 0);
  int j = 0;
  if (m > 0) {
    if (a[0] != 1) {
      dp[0] = 1;
      dp[1] = 1;
    } else if (a[0] == 1) {
      if (m > 1) {
        if (a[1] != 2) {
          dp[0] = 1;
          dp[1] = 0;
          j++;
        } else {
          dp[0] = 0;
          dp[1] = 0;
          cout << 0 << endl;
          return 0;
        }
      }
    }
  }
  for (int i = 2; i < n + 1; i++) {
    if (a[j] != i) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= MOD;
    } else {
      dp[i] = 0;
      j++;
    }
  }
  cout << dp[n] << endl;
}
