#include <bits/stdc++.h>
using namespace std;
vector<int> table;
vector<bool> a;
int PRIME = 1000000007;
int main(int argc, char* argv[]) {
  int N, M;
  cin >> N >> M;
  a.resize(N, true);
  for (int i = 0; i < M; ++i) {
    int n;
    cin >> n;
    a[n] = false;
  }
  table.resize(N, 0);
  if (N == 1) {
    cout << 1;
    return 1;
  }
  if (a[N - 1]) {
    table[N - 1] = 1;
  }
  if (a[N - 2]) {
    table[N - 2] = 1 + table[N - 1];
  }
  for (int i = N - 3; i >= 0; --i) {
    if (a[i]) {
      table[i] = table[i + 1] + table[i + 2];
      table[i] %= PRIME;
    }
  }
  cout << table[0];
}
