#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool amax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool amin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
struct aaa {
  aaa() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  };
} aaaaaaa;
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1},
          dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
signed main() {
  int n, m;
  cin >> n >> m;
  vector<int> dp(n + 1, 0);
  vector<bool> issafe(n + 1, true);
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    issafe[a] = false;
  }
  dp[0] = 1;
  if (issafe[1]) dp[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (issafe[i - 1]) dp[i] += dp[i - 1];
    if (issafe[i - 2]) dp[i] += dp[i - 2];
    dp[n] %= MOD;
  }
  cout << dp[n] << endl;
  return 0;
}
