#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
template <class T = long long>
T input() {
  T x;
  cin >> x;
  return x;
}
template <class T>
void output(T x) {
  cout << x << endl;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
int main() {
  long long N = input();
  long long M = input();
  vector<int> a;
  for (long long i = 0; i < M; i++) {
    a.push_back(input());
  }
  vector<long long> dp;
  dp.resize(N + 1, 0);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i < N + 1; i++) {
    if (std::count(a.begin(), a.end(), i)) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cerr << "dp[N] % 1000000007"
       << ": " << dp[N] % 1000000007 << '\n';
  ;
  return 0;
}
