#include <bits/stdc++.h>
using namespace std;
int N, M;
int ans = 0;
bool A[100000] = {false};
long long dp[100000] = {0};
int main() {
  cin >> N >> M;
  dp[0] = 1;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    a = a - 1;
    A[a] = true;
  }
  for (int i = 0; i < N; i++) {
    if (A[i]) {
      dp[i] = 0;
    } else if (i == 0) {
      dp[i] = 1;
    } else if (i == 1) {
      dp[i] = dp[i - 1] + 1;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[N - 1] % 1000000007 << endl;
  return 0;
}
