#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = -100100100;
const ll M = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> cnt(m + 2), a(n + 10), b(n + 10);
  for (int i = 0; i < (m); ++i) cin >> cnt[i];
  int l = 0;
  if (m != 0) {
    for (int i = 0; i < (n); ++i) {
      if (cnt[l] - 1 == i) {
        a[i] = 1;
        ++l;
      }
    }
  }
  for (int i = 0; i < (n); ++i) {
    if (i == 0)
      b[i] = 1;
    else if (i == 1) {
      if (a[i - 1])
        b[i] = 1;
      else
        b[i] = 2;
    } else {
      if (a[i - 1] && a[i - 2]) {
        cout << 0 << endl;
        return 0;
      } else if (a[i - 1] && a[i - 2] == 0) {
        b[i] = b[i - 2];
      } else if (a[i - 2]) {
        b[i] = b[i - 1];
      } else {
        b[i] = b[i - 1] + b[i - 2];
      }
    }
  }
  cout << b[n - 1] % M << endl;
  return 0;
}
