#include <bits/stdc++.h>
using namespace std;
long long n, m;
map<long long, bool> a;
vector<long long> seen;
long long search(long long p) {
  if (p == n - 1) {
    return 1;
  }
  long long ret = 0;
  if (seen[p + 1] != -1) {
    ret += seen[p + 1];
  } else {
    if (!a[p + 1] && p + 1 < n) {
      ret += search(p + 1);
    }
  }
  if (seen[p + 2] != -1) {
    ret += seen[p + 2];
  } else {
    if (!a[p + 2] && p + 2 < n) {
      ret += search(p + 2);
    }
  }
  if (p != -1) seen[p] = ret % 1000000007;
  return ret % 1000000007;
}
int main() {
  cin >> n >> m;
  for (long long i = 0; i < n; i++) a[i] = false;
  for (long long i = 0; i < m; i++) {
    long long tmp;
    cin >> tmp;
    a[tmp - 1] = true;
  }
  seen.assign(n, -1);
  long long ans = search(-1);
  cout << ans % 1000000007 << endl;
  return 0;
}
