#include <bits/stdc++.h>
using namespace std;
const int ___div = 1000000007;
int N, M;
int A[200000];
int dp[200000];
int main() {
  ios::sync_with_stdio(false);
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> A[i];
  }
  int j = 0;
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (i == A[j]) {
      j++;
      continue;
    }
    dp[i + 1] += dp[i];
    dp[i + 1] = dp[i + 1] % ___div;
    dp[i + 2] += dp[i];
    dp[i + 2] = dp[i + 2] % ___div;
  }
  cout << dp[N];
  return 0;
}
