#include <bits/stdc++.h>
using namespace std;
const long long int INF = 99999999999999;
const long long int MOD = 1000000007;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a;
  for (long long int i = 0; i < long long int(m); i++) {
    long long int x;
    cin >> x;
    a.push_back(x);
  };
  vector<long long int> s(n + 1, 0);
  s[0] = 1;
  long long int point = 0;
  if (a[0] == 1) {
    s[1] = 0;
    point++;
  } else {
    s[1] = 1;
  }
  for (long long int i = 2; i <= n; i++) {
    if (a[point] == i) {
      s[i] = 0;
      point++;
    } else {
      s[i] = (s[i - 1] + s[i - 2]) % MOD;
    }
  }
  cout << s[n];
  return 0;
}
