#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<int> dp(n + 1, 0);
  for (int i = 0; i < m; i++) {
    dp[a[i]] = -1;
  }
  if (a[0] == 1) {
    dp[0] = 0;
    dp[1] = 0;
    dp[2] = 1;
    for (int i = 3; i <= n; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
        continue;
      }
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= 1000000007;
    }
  } else {
    dp[0] = 0;
    dp[1] = 1;
    for (int i = 2; i <= n; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
        continue;
      }
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= 1000000007;
    }
  }
  cout << dp[n] << endl;
}
