#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;
int main() {
  in n, m;
  cin >> n >> m;
  vector<in> a(m);
  for (int i = 0; i < (int)(m); i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  in dp[100010];
  dp[1] = 1;
  dp[2] = 2;
  if (a[0] == 1) {
    dp[1] = 0;
    dp[2] = 1;
    a.erase(a.begin());
  }
  if (!a.empty()) {
    if (a[0] == 2) {
      dp[2] = 0;
      a.erase(a.begin());
    }
  }
  for (in i = 3; i <= n; i++) {
    if (!a.empty()) {
      if (i == a[0]) {
        dp[i] = 0;
        a.erase(a.begin());
        continue;
      }
    }
    dp[i] = dp[i - 1] + dp[i - 2];
    if (dp[i] >= waru) dp[i] -= waru;
  }
  cout << dp[n];
}
