#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  int a[M];
  for (int i = 0; i < M; ++i) cin >> a[i];
  long long dp[100100];
  for (int i = 0; i < 100100; ++i) dp[i] = -1;
  dp[0] = 1;
  dp[1] = 1;
  long long tmp = 0;
  for (int i = 0; i < 100000; ++i) {
    for (int i = 0; i < M; ++i) dp[a[i]] = 0;
    tmp = dp[i + 1] + dp[i];
    if (tmp > 1000000007) tmp %= 1000000007;
    chmax(dp[i + 2], tmp);
  };
  cout << dp[N] << endl;
}
