#include <bits/stdc++.h>
using namespace std;
int main() {
  long long dp[100001];
  priority_queue<int, vector<int>, greater<int> > a;
  int N, M;
  memset(dp, 0, sizeof(dp));
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int n;
    cin >> n;
    a.push(n);
  }
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (i == a.top()) {
      a.pop();
      continue;
    }
    if (i == 1) {
      dp[1] = dp[0];
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
