#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;
const in INF = 1 << 30;
bool chmin(in &a, in b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  in n, m;
  vector<in> a(m);
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  in dp[100010];
  for (int i = 0; i < (int)(n + 1); i++) dp[i] = INF;
  dp[1] = 1;
  dp[2] = 1;
  for (in i = 3; i <= n; i++) {
    if (i == a[0]) {
      dp[i] = 0;
      a.erase(a.begin());
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << (dp[n] % waru);
}
