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