#include <bits/stdc++.h>
const int INF = 1000000007;
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;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long dp[100010];
long long v[100010];
int main() {
  int n, m;
  cin >> n >> m;
  int temp;
  for (int i = 0; i < (m); ++i) {
    cin >> temp;
    v[temp] = 1;
  }
  dp[0] = 1;
  if (v[0] != 1) dp[1] = 1;
  for (int i = 2; i < (m + 1); ++i) {
    if (v[i - 1] != 1) dp[i] += dp[i - 1];
    if (v[i - 2] != 1) dp[i] += dp[i - 2];
    dp[i] %= INF;
  }
  cout << dp[n] << endl;
  return 0;
}
