#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  const long long mod = 1e9 + 7;
  vector<long long> st(n + 1);
  long long a;
  for (int i = 0; i < m; i++) {
    cin >> a;
    st[a] = 1;
  }
  vector<long long> dp(n + 1);
  dp[1] = 1;
  dp[2] = 2;
  if (st[1] == 1) {
    dp[1] = 0;
    dp[2] = 1;
  }
  if (st[2] == 1) {
    dp[1] = 1;
    dp[2] = 0;
  }
  for (int i = 3; i < n + 1; i++) {
    if (st[i] == 0) {
      dp[i] = dp[i - 1] % mod + dp[i - 2] % mod;
    } else {
      dp[i] == 0;
    }
  }
  cout << dp[n] % mod << endl;
  return 0;
}
