#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int mod = 1000000007;
P ar4[4] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
P ar8[8] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1},
            {0, 1},   {1, -1}, {1, 0},  {1, 1}};
int dp[100001];
__attribute__((constructor)) void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> A(m);
  for (int i = 0; m > i; i++) {
    cin >> A[i];
  }
  dp[0] = 1;
  int nw = 0;
  for (int i = 0; n > i; i++) {
    if (A[nw] == i) {
      nw++;
      continue;
    }
    dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
    dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
  }
  cout << dp[n] << endl;
}
