#include <bits/stdc++.h>
using ll = long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> a(n + 1, false);
  for (int i = 0; i < m; ++i) {
    int b;
    cin >> b;
    a[b] = true;
  }
  vector<ll> f(n + 1);
  f[0] = f[1] = 1;
  for (int i = 2; i <= n; ++i) {
    f[i] = f[i - 1] % mod + f[i - 2] % mod;
    if (a[i]) f[i] = 0;
  }
  cout << f[n] << endl;
  return 0;
}
