#include <bits/stdc++.h>
long long mod = 1e9 + 7;
using namespace std;
long long inputValue() {
  long long a;
  cin >> a;
  return a;
};
void inputArray(int* p, long long a) {
  for (long long i = (0); i < (a); i++) {
    cin >> p[i];
  }
};
template <typename T>
void inputVector(vector<T>& p, long long a) {
  for (long long i = (0); i < (a); i++) {
    T input;
    cin >> input;
    p.emplace_back(input);
  }
}
template <typename T>
void output(T a) {
  cout << a << "\n";
}
long long solve(long long src, set<long long>& a) {
  static map<long long, long long> list;
  if (src <= 0) return 0;
  if (src == 1) return 1;
  if (src == 2) return 2;
  if (a.find(src) != a.end()) return 0;
  if (list.find(src) != list.end()) return list[src] % mod;
  list[src] = (solve(src - 1, a) % mod) + (solve(src - 2, a) % mod);
  return list[src] % mod;
}
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  set<long long> a;
  cin >> n >> m;
  for (long long i = (0); i < (m); i++) {
    long long t;
    cin >> t;
    a.insert(t);
  }
  cout << solve(n, a) << endl;
  return 0;
}
