#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, m, n;
  cin >> n >> m;
  map<long long, long long> mt;
  for (i = 0; i < m; i++) {
    cin >> j;
    mt[j] = 1;
  }
  long long dp[n + 1];
  memset(dp, 0, sizeof dp);
  long long ctr = 0;
  dp[0] = 1;
  for (i = 1; i <= n; i++) {
    if (mt[i] == 1) continue;
    if (ctr < 1) {
      dp[i] = 1;
      ctr++;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
  }
  cout << dp[n];
  return 0;
}
