#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int a[m];
  set<long long int> s;
  for (long long int i = 0; i < m; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  long long int dp[n + 5];
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  if (s.find(1) != s.end()) {
    dp[1] = 0;
    dp[2] = 1;
  }
  if (s.find(2) != s.end()) {
    dp[2] = 0;
  }
  for (long long int i = 3; i <= n; i++) {
    if (s.find(i) != s.end()) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[3] % MOD << "\n";
  return 0;
}
