#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
const long long INF = 1LL << 60;
bool vector_finder(std::vector<long long> vec, long long number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return true;
  } else {
    return false;
  }
}
long long N, M;
std::vector<long long> A;
std::vector<long long> DP;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  N++;
  for (long long i = long long(0); i < long long(M); ++i) {
    long long a;
    cin >> a;
    a++;
    A.push_back(a);
    if (i != 0) {
      if (a == A[i - 1] + 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  for (long long i = long long(0); i < long long(N); ++i) {
    if (i == 0) {
      DP.push_back(1);
      continue;
    }
    if (vector_finder(A, N - i)) {
      DP.push_back(0);
      continue;
    }
    long long tmp = 0;
    if (i - 1 >= 0) {
      tmp = (tmp + (DP[i - 1] % 1000000007)) % 1000000007;
    }
    if (i - 2 >= 0) {
      tmp = (tmp + (DP[i - 2] % 1000000007)) % 1000000007;
    }
    DP.push_back(tmp);
  }
  cout << DP.back() << endl;
  return 0;
}
