#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (auto& A : a) cin >> A;
  vector<int> path(N + 1);
  path[0] = 1;
  int idx = 0;
  int mod = 1000000007;
  for (int i = 1; i <= N; ++i) {
    if (a[idx] == i) {
      path[i] = 0;
      ++idx;
      continue;
    }
    int sum = 0;
    if (0 <= i - 1) sum += path[i - 1];
    if (0 <= i - 2) sum += path[i - 2];
    path[i] = sum % mod;
  }
  cout << path[N];
  return 0;
}
