#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const double PI = acos(-1);
vector<long long> step(100010, 1), dp(100010);
long long n, m;
void solve() {
  dp[0] = 0;
  dp[1] += step[1];
  dp[2] += step[2];
  for (long long i = 3; i < n + 1; i++) {
    dp[i] = (step[i] ? dp[i - 1] + dp[i - 2] : 0);
    dp[i] %= MOD;
  }
}
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  long long a;
  for (long long i = 0; i < m; i++) {
    cin >> a;
    step[a] = 0;
  }
  solve();
  cout << dp[n] % MOD << endl;
}
