#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = 1000000007ll;
  int N, M;
  cin >> N >> M;
  vector<long long> stairs(N, -1ll);
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  stairs.at(0) = 1ll;
  stairs.at(1) = 2ll;
  for (int i = 0; i < M; ++i) {
    int x;
    cin >> x;
    stairs.at(x - 1) = 0ll;
  }
  if (N == 2 && stairs.at(0) == 0ll) {
    cout << 1 << endl;
    return 0;
  } else if (N == 2) {
    cout << 2 << endl;
    return 0;
  }
  if (stairs.at(0) == 0ll && stairs.at(1) != 0ll) stairs.at(1) = 1ll;
  for (int i = 1; i < N - 1; ++i) {
    if (stairs.at(i + 1) != 0ll) {
      stairs.at(i + 1) = stairs.at(i - 1) + stairs.at(i);
    }
  }
  cout << stairs.at(N - 1) % mod << endl;
}
