#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m;
  cin >> n >> m;
  unsigned long long ans[100005];
  bool hole[100005];
  for (long i = 0; i < m; i++) {
    long a;
    cin >> a;
    hole[a] = true;
  }
  ans[1] = 1;
  ans[2] = 2;
  if (hole[1] == true) {
    ans[1] = 0;
    ans[2] = 1;
  }
  if (hole[2] == true) {
    ans[2] = 0;
  }
  for (long i = 3; i < n + 5; i++) {
    ans[i] = ans[i - 2] + ans[i - 1];
    ans[i] %= ans[i];
    if (hole[i] == true) {
      ans[i] = 0;
    }
  }
  cout << ans[n] % 1000000007 << endl;
}
