#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct edge {
  int to, cost;
};
const int INF = 1e9;
const double EPS = 1e-10;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const int mx4[] = {0, 1, 0, -1};
const int my4[] = {1, 0, -1, 0};
const int mx8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int my8[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll dp[100010];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (int)(m); i++) cin >> a[i];
  dp[0] = 1;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (i == a[cnt]) {
      cnt++;
      continue;
    }
    if (i == 1)
      dp[i] = 1;
    else
      dp[i] = (dp[i - 2] + dp[i - 1]) % MOD;
  }
  cout << dp[n] << "\n";
  return 0;
}
