#include <bits/stdc++.h>
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<vector<int>>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const int modn = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> broken(n);
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    broken[a] = 1;
  }
  vector<ll> dp(n + 1);
  for (int i = 0; i <= n; ++i) {
    if (!broken[i]) {
      if (i == 0)
        dp[i] = 1;
      else if (i == 1)
        dp[i] = 1;
      else
        dp[i] = (dp[i - 1] + dp[i - 2]) % modn;
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[n] << endl;
}
