#include <bits/stdc++.h>
using ll = long long;
using namespace std;
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 n, m, t;
int a[100000];
ll dp[100001];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    cin >> t;
    a[t] = 1;
  }
  dp[0] = 1;
  for (int i = 1; i <= (int)(n); i++) {
    if (a[i]) continue;
    dp[i] += dp[i - 1];
    if (i > 1) dp[i] += dp[i - 2];
    dp[i] %= 1000000007;
  }
  cout << dp[n] << endl;
}
