#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
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;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> a(n + 1);
  for (int i = 0; i < n + 1; ++i) a[i] = 0;
  for (int i = 0; i < m; ++i) {
    int b;
    cin >> b;
    a[b] = -1;
  }
  a[0] = a[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i] == -1) {
      a[i] = 0;
      continue;
    }
    a[i] = a[i - 1] % MOD + a[i - 2] % MOD;
    a[i] %= MOD;
    if (a[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << a[n] << endl;
  return 0;
}
