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