#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int mod = 1e9 + 7;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  vector<int> k(N + 1);
  k[0] = 1;
  for (int i = 1, j = 0; i <= N; i++) {
    if (j < M && a[j] == i) {
      j++;
    }
    if (i == 1) {
      k[i] += k[i - 1];
    } else {
      k[i] += k[i - 1] + k[i - 2];
    }
    k[i] %= mod;
  }
  cout << k[N] << endl;
  return 0;
}
