#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> a(N, true);
  vector<long long> sum(N, 0);
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    a[x - 1] = false;
  }
  if (a[0] == true) {
    sum[0] = 1;
    if (a[1] == true) sum[1] = 2;
  } else {
    if (a[1] == true) sum[1] = 1;
  }
  for (int i = 2; i < N; i++) {
    if (a[i] == true) {
      sum[i] = sum[i - 2] + sum[i - 1];
    }
  }
  cout << sum[N - 1] % 1000000007 << endl;
}
