#include <bits/stdc++.h>
using namespace std;
long int MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  int* a_arr = (int*)malloc(sizeof(int) * m);
  for (int i = 0; i < m; i++) {
    cin >> a_arr[i];
  }
  long int* patterns = (long int*)malloc(sizeof(long int) * (n + 1));
  patterns[0] = 1;
  int i = 1;
  int j = 0;
  while (i <= n) {
    patterns[i] = (patterns[i - 1] + (i == 1 ? 1 : patterns[i - 2])) % MOD;
    if (a_arr[j] == i) {
      patterns[i] = 0;
      j++;
    }
    i++;
  }
  cout << patterns[n] << endl;
  return 0;
}
