#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  long long step[n + 2];
  step[0] = 0;
  step[1] = 1;
  int count = 0;
  for (int i = 2; i <= n + 1; i++) {
    if (i - 1 == a[count] && count != m) {
      count++;
      step[i] = 0;
    } else {
      step[i] = step[i - 1] + step[i - 2];
    }
  }
  cout << step[n + 1] % 1000000007 << endl;
  return 0;
}
