#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
static const long long mod = 1000000007LL;
int dp[100010];
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> a(n + 1, true);
  for (long long i = 0; i < (n); ++i) {
    int first;
    cin >> first;
    a[first] = false;
  }
  dp[0] = 1;
  for (long long i = 0; i < (n + 1); ++i) {
    if (a[i + 1]) dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
    if (a[i + 2]) dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
  }
  cout << dp[n] << endl;
}
