#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  int steps[N + 2], a[N + 2];
  for (int i = 1; i <= N; ++i) a[i] = 0;
  for (int i = 0; i < M; ++i) {
    int x;
    cin >> x;
    a[x] = 1;
  }
  steps[0] = 1;
  for (int i = 1; i <= N; ++i) {
    steps[i] = (steps[i - 1] + steps[i - 2]) % mod;
    if (a[i]) steps[i] = 0;
  }
  cout << steps[N] << "\n";
  return 0;
}
