#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
ll gcd(ll a, ll b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll waz = 1000000007;
ll inv(ll x) {
  if (x == 1) {
    return 1;
  }
  if (x == 0) {
    return 0;
  } else {
    ll a = (waz - inv(waz % x) * (waz / x)) % waz;
    if (a >= 0) {
      return a;
    } else {
      return waz + a;
    }
  }
}
void printVector(const vector<int>& vec) {
  for (int value : vec) {
    cout << value << " ";
  }
  cout << endl;
}
vector<ll> p;
ll phi(ll x) {
  ll a = x;
  ll b = x;
  for (ll k = 0; k != p.size(); ++k) {
    if (a % p[k] == 0) {
      while (a % p[k] == 0) {
        a /= p[k];
      }
      b = b / p[k] * (p[k] - 1);
    }
    if (a == 1) {
      break;
    }
  }
  return b;
}
bool my_compare(pair<string, int> a, pair<string, int> b) {
  if (a.first != b.first) {
    return a.first < b.first;
  }
  if (a.second != b.second) {
    return a.second > b.second;
  } else {
    return true;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int N, M;
  cin >> N >> M;
  vi a(M), b(N + 1);
  for (int i = 0; i < (int)M; ++i) cin >> a[i];
  b[0] = 1;
  if (count(a.begin(), a.end(), 0)) {
    b[0] = 0;
  }
  b[1] = 1;
  if (count(a.begin(), a.end(), 1)) {
    b[1] = 0;
  }
  for (int i = 2; i < N + 1; ++i) {
    b[i] = (b[i - 1] + b[i - 2]) % waz;
    if (count(a.begin(), a.end(), i)) {
      b[i] = 0;
    }
  }
  cout << b[N] << endl;
}
