#include <bits/stdc++.h>
using namespace std;
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int dy4[] = {0, 0, 1, -1};
int dx4[] = {1, -1, 0, 0};
int dx8[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy8[] = {1, -1, 0, 0, 1, -1, -1, 1};
int main() {
  int N, M;
  cin >> N >> M;
  int a[N + 1];
  for (int i = 0; i < N + 1; i++) a[i] = 0;
  for (int i = 0; i < M; i++) {
    int b;
    cin >> b;
    a[b] = 1;
  }
  long long dp[N + 5];
  for (int i = 0; i < N + 5; i++) dp[i] = 0;
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 0; i < N + 1; i++) {
    if (i == 0 || i == 1) continue;
    dp[i] += (a[i - 2] ? 0 : dp[i - 2]);
    dp[i] += (a[i - 1] ? 0 : dp[i - 1]);
  }
  cout << dp[N] % 1000000007 << "\n";
  return 0;
}
