#include <bits/stdc++.h>
using namespace std;
using S = set<long long>;
using D = deque<long long>;
using L = vector<long long>;
using M = map<int, long long>;
using A = vector<vector<long long>>;
using Q = priority_queue<long long>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  long long mod = 1000000007;
  cin >> n >> m;
  L l(m, 0);
  L dp(100010, 0);
  dp[0] = 1;
  for (int i = 0; i < m; i++) {
    cin >> l[i];
  }
  for (int i = 0; i < n; i++) {
    if (not(find(l.begin(), l.end(), i + 1) != l.end())) {
      dp[i + 1] += dp[i] % mod;
    }
    if (not(find(l.begin(), l.end(), i + 2) != l.end())) {
      dp[i + 2] += dp[i] % mod;
    }
  }
  cout << dp[n] % mod << endl;
}
