#include <bits/stdc++.h>
using namespace std;
int N, M;
bool A[100010];
int mod = 1e9 + 7;
int input() {
  cin >> N >> M;
  for (int i = 0; i < 100010; ++i) A[i] = 1;
  for (int i = 0; i < M; ++i) {
    int a;
    cin >> a;
    A[a] = 0;
  }
}
int solve() {
  int dp[N + 10];
  dp[N] = 0;
  for (int i = N - 1; i >= 0; --i) {
    if (A[i] == 0) {
      dp[i] = 0;
      continue;
    }
    if (i == N - 1)
      dp[i] = 1;
    else if (i == N - 2)
      dp[i] = 2;
    else
      dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
  }
  cout << dp[0] << endl;
}
int main() {
  cin.tie();
  ios::sync_with_stdio(false);
  input();
  solve();
  return 0;
}
