#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007;
const long long mod = 998244353;
struct H {
  long long x, y;
  bool operator<(const H& b) const {
    if (x != b.x) return x < b.x;
    return y < b.y;
  }
  bool operator>(const H& b) const {
    if (x != b.x) return x > b.x;
    return y > b.y;
  }
  bool operator==(const H& b) const { return x == b.x && y == b.y; }
  bool operator!=(const H& b) const { return (*this) != b; }
};
struct P {
  long long pos, cost;
  bool operator<(const P& b) const { return cost < b.cost; }
  bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
  long long to, cost;
};
struct E {
  long long from, to, cost;
  bool operator<(const E& b) const { return cost < b.cost; }
  bool operator>(const E& b) const { return cost > b.cost; }
};
template <typename T, typename U>
void chmin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void chmax(T& a, U b) {
  if (a < b) a = b;
}
template <typename T>
T max_0(T a) {
  if (a < 0) return 0;
  return a;
}
template <typename T>
T min_0(T a) {
  if (a > 0) return 0;
  return a;
}
long long read() {
  long long u;
  long long k = scanf("%lld", &u);
  return u;
}
long long gcd(long long i, long long j) {
  if (i > j) swap(i, j);
  if (i == 0) return j;
  return gcd(j % i, i);
}
long long mod_pow(long long x, long long n, long long p) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % p;
    x = x * x % p;
    n >>= 1;
  }
  return res;
}
const long long Inf = 3023372036854775807;
const int inf = 1500000000;
long long n, m;
long long dp[200000];
bool a[200000];
signed main() {
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    a[read()] = 1;
  }
  dp[0] = 1;
  for (long long i = 1; i <= n; i++) {
    if (a[i]) continue;
    dp[i] += dp[i - 1];
    if (i > 1) dp[i] += dp[i - 2];
    dp[i] %= Mod;
  }
}
