#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const static int INF = 1000000000;
const static int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
void cum_sum(int N, vector<double> a, vector<double> &s) {
  for (int i = 0; i < N; i++) {
    s[i + 1] = s[i] + a[i];
  }
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
bool is_prime(long long n) {
  if (n <= 1) return false;
  for (long long p = 2; p * p <= n; ++p) {
    if (n % p == 0) return false;
  }
  return true;
}
int getdigit(long long num) {
  unsigned digit = 0;
  while (num != 0) {
    num /= 10;
    digit++;
  }
  return digit;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, M;
  cin >> N >> M;
  vector<long long> a(N);
  set<long long> out;
  for (long long i = 0; i < (long long)(M); i++) {
    cin >> a[i];
    out.insert(a[i]);
  }
  vector<long long> DP(N + 1);
  DP[0] = 1;
  DP[1] = 1;
  for (long long i = 1; i < N + 1; i++) {
    if (out.find(i - 1) == out.end()) {
      DP[i] = DP[i - 1];
    }
    if (i > 1) {
      if (out.find(i - 2) == out.end()) {
        DP[i] += DP[i - 2];
      }
    }
  }
  cout << DP[N] % MOD << endl;
}
