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