#include <bits/stdc++.h>
using namespace std;
int H, W, N, M;
int x, y;
int main() {
  cin >> N >> M;
  vector<long long int> dp(N + 1, 1);
  for (int i = 0; i < M; i++) {
    int tmp;
    cin >> tmp;
    dp[tmp] = 0;
  }
  if (dp[1] == 0 && dp[2] != 0) {
    dp[2] = 1;
  } else if (dp[2] == 0) {
    dp[2] = 0;
  } else {
    dp[2] = 2;
  }
  for (int i = 3; i < N + 1; i++) {
    if (dp[i] != 0) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[N] % 1000000007 << endl;
}
