#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
const int MOD = 1000000007;
long long dp[100001];
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); ++i) {
    int t;
    cin >> t;
    a[t] = 1;
  }
  for (int i = 0; i < (n + 1); ++i) {
    if (i <= 0)
      dp[i] = 1;
    else if (a[i])
      dp[i] = 0;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  cout << dp[n] << endl;
}
int main() {
  solve();
  return 0;
}
