#include <bits/stdc++.h>
using namespace std;
int N, M, A[100000];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) cin >> A[i];
  for (int i = 0; i < M - 1; i++) {
    if (A[i] == A[i + 1] - 1) {
      cout << "0" << endl;
      return 0;
    }
  }
  int64_t DP[100001];
  DP[0] = 1;
  DP[1] = 1;
  int j = 0;
  for (int i = 2; i <= N; i++) {
    if (j < M && i == A[j]) {
      DP[i] = 0;
      j++;
    } else {
      DP[i] = (DP[i - 1] + DP[i - 2]) % 1000000007;
      ;
    }
  }
  cout << DP[N] << endl;
}
