#include <bits/stdc++.h>
using namespace std;
const long long P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int N;
long long h[100010];
long long dp[100010];
int main() {
  cout << fixed << setprecision(10);
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = (0); i < (M); ++i) cin >> a[i];
  for (int i = (0); i < (100010); ++i) dp[i] = 0;
  for (int i = (0); i < (M); ++i) dp[a[i]] = -1;
  dp[0] = 1;
  if (a[0] != 1) {
    dp[1] = 1;
  } else {
    dp[1] = 0;
  }
  for (int i = 2; i < N + 1; i++) {
    if (dp[i] != -1) {
      dp[i] = dp[i - 2] + dp[i - 1];
    } else {
      dp[i] = 0;
    }
    dp[i] = dp[i] % P;
  }
  cout << dp[N] % P << endl;
  return 0;
}
