#include <bits/stdc++.h>
using namespace std;
long long a[100001], b, c, d, n, m, p, q, x, y, k, h, w, sum, mi, ma, ans, l, r,
    res;
string s;
long long dp[100001];
void solve() {
  for (long long i = long long(0); i < long long(n + 1); ++i) {
    dp[i] %= (long long)(1e9 + 7);
    if (!a[i + 1]) dp[i + 1] += dp[i];
    if (!a[i + 2]) dp[i + 2] += dp[i];
  }
}
int main() {
  cin >> n >> m;
  for (long long i = long long(0); i < long long(m); ++i) {
    cin >> b;
    a[b] = 1;
  }
  dp[0] = 1;
  solve();
  for (long long i = long long(0); i < long long(n + 1); ++i)
    cerr << "dp[i]"
         << "=" << dp[i] << endl;
  ;
  cout << (dp[n] % (long long)(1e9 + 7)) << endl;
  return 0;
}
