#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b);
size_t length(const std::string& str) { return str.length(); }
int main() {
  int n, m, p = 0;
  vector<long long int> a(10000000);
  vector<long long int> ans(1000000);
  ans[0] = 1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  if (a[0] == 1)
    p++;
  else
    ans[1] = 1;
  for (int i = 2; i < n + 1; i++) {
    ans[i] = (ans[i - 1] + ans[i - 2]);
    if (i == a[p]) {
      ans[i] = 0;
      p++;
    }
  }
  cout << ans[n] % 1000000007 << endl;
  return 0;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
