#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < m; i++) {
    cin >> v[i];
  }
  vector<long long int> dp(n + 2, 0);
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 0; i < m; i++) {
    dp[v[i]] = -1;
  }
  if (dp[1] == -1) {
    dp[2]--;
  }
  if (dp[1] == -1 && dp[2] == -1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 3; i <= n + 1; i++) {
    if (dp[i] == -1) {
      continue;
    } else {
      if (dp[i - 1] != -1) {
        dp[i] += dp[i - 1];
      }
      if (dp[i - 2] != -1) {
        dp[i] += dp[i - 2];
      }
    }
    dp[i] %= 1000000007;
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
