#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chman(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 63 - 1;
const long long MOD = 1e9 + 7;
struct SegmentTree {
 private:
  long long unit = 0;
  long long op(long long a, long long b) { return a + b; }
  long long n;
  vector<long long> node;

 public:
  SegmentTree(vector<long long> v) {
    long long sz = (long long)v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1, unit);
    for (long long i = 0; i < sz; i++) node[i + n - 1] = v[i];
    for (long long i = n - 2; i >= 0; i--)
      node[i] = op(node[2 * i + 1], node[2 * i + 2]);
  }
  void update(long long x, long long val) {
    x += n - 1;
    node[x] += val;
    while (x > 0) {
      x = (x - 1) / 2;
      node[x] = op(node[2 * x + 1], node[2 * x + 2]);
    }
  }
  long long query(long long a, long long b, long long k = 0, long long l = 0,
                  long long r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l) return unit;
    if (a <= l && r <= b) return node[k];
    long long vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
    long long vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
    return op(vl, vr);
  }
};
struct LazySegmentTree {
 private:
  long long n;
  vector<long long> node, lazy;

 public:
  LazySegmentTree(vector<long long> v) {
    long long sz = (long long)v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1);
    lazy.resize(2 * n - 1);
    for (long long i = 0; i < sz; i++) node[i + n - 1] = v[i];
    for (long long i = n - 2; i >= 0; i--)
      node[i] = node[2 * i + 1] + node[2 * i + 2];
  }
  void lazyEval(long long k, long long l, long long r) {
    if (lazy[k] != 0) {
      node[k] += lazy[k];
      if (r - l > 1) {
        lazy[2 * k + 1] += lazy[k] / 2;
        lazy[2 * k + 2] += lazy[k] / 2;
      }
      lazy[k] = 0;
    }
  }
  void update(long long a, long long b, long long x, long long k = 0,
              long long l = 0, long long r = -1) {
    if (r < 0) r = n;
    lazyEval(k, l, r);
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      lazy[k] += (r - l) * x;
      lazyEval(k, l, r);
    } else {
      update(a, b, x, 2 * k + 1, l, (l + r) / 2);
      update(a, b, x, 2 * k + 2, (l + r) / 2, r);
      node[k] = node[2 * k + 1] + node[2 * k + 2];
    }
  }
  long long query(long long a, long long b, long long k = 0, long long l = 0,
                  long long r = -1) {
    if (r < 0) r = n;
    if (b <= l || r <= a) return 0;
    lazyEval(k, l, r);
    if (a <= l && r <= b) return node[k];
    long long vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
    long long vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
    return vl + vr;
  }
  long long at(long long a) { return query(a, a + 1); }
};
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; ++i) cin >> a[i];
  vector<bool> br(N, false);
  for (long long i = 0; i < M; ++i) br[a[i]] = true;
  vector<long long> dp(N + 5, 0);
  dp[0] = 1;
  for (long long i = 0; i < N + 1; ++i) {
    if (br[i + 1])
      dp[i + 1] = 0;
    else
      dp[i + 1] += dp[i];
    if (br[i + 2])
      dp[i + 2] = 0;
    else
      dp[i + 2] += dp[i];
    dp[i] %= MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
