#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, i, j, k, x, ans, MOD = 1000000007;
  cin >> n >> m;
  vector<bool> broken(n + 1, false);
  for (i = 0; i < m; i++) {
    cin >> x;
    broken[x] = true;
  }
  vector<long long> dp(n + 1, 0);
  dp[0] = 0;
  for (i = 1; i <= n; i++) {
    if (broken[i]) continue;
    dp[i] = dp[i - 1];
    if (i - 2 >= 0) dp[i] += dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[n] << "\n";
  return 0;
}
