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