#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, M;
const ll DIV = 1000000007;
int as[100100];
ll dp[100100];
ll rec(int n) {
  if (0 <= dp[n]) return dp[n];
  if (as[n] == 1) {
    dp[n] = 0;
    return dp[n];
  }
  if (n <= 1) return 1;
  dp[n] = rec(n - 1) + rec(n - 2);
  return dp[n];
}
void solve() {
  cin >> N >> M;
  for (int i = 0; i < M; ++i) {
    int ai;
    cin >> ai;
    as[ai] = 1;
  }
  for (int i = 0; i < 100100; ++i) dp[i] = -1;
  cout << rec(N) % DIV << endl;
}
int main() {
  solve();
  return 0;
}
