#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll dp[100005];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> c(n + 1, 2);
  int buf(0);
  for (int i = 0; i < (m); ++i) {
    int k;
    cin >> k;
    if (buf + 1 == k && i >= 1) {
      cout << "0";
      return 0;
    }
    buf = k;
    c[k] = 0;
    c[k - 1] -= 1;
    if (k - 2 < 0) continue;
    c[k - 2] -= 1;
  }
  ll ans(1);
  ll mod = 1000000007;
  dp[0] = 1;
  for (int i = 0; i < (n + 1); ++i) {
    if (i == 0) continue;
    if (c[i] == 0) continue;
    if (i == 1) {
      dp[i] = 1;
      continue;
    }
    dp[i] = dp[i - 2] + dp[i - 1];
    dp[i] %= mod;
  }
  cout << dp[n];
  return 0;
}
