#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
using vector3 = vector<vector2<T>>;
template <typename T>
using vector4 = vector<vector3<T>>;
using lint = long long;
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) {
    is >> x;
  }
  return is;
}
int N, M;
vector<int> A;
bool koware(int n) {
  if (find((A).begin(), (A).end(), n) != A.end()) {
    return true;
  } else {
    return false;
  }
}
int main() {
  cin >> N >> M;
  A = vector<int>(M);
  cin >> A;
  vector<int> dp(N);
  dp[0] = 1;
  dp[1] = koware(1) ? 0 : 1;
  for (int i = 2; i < N; i++) {
    if (!koware(i)) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
  }
  cout << (dp[N - 1] + dp[N - 2]) % 1000000007 << endl;
}
