#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int N, M, c_2, c_1, c_0;
  cin >> N;
  cin >> M;
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  c_2 = 1;
  int next;
  cin >> next;
  if (next == 0) {
    c_1 = 0;
    cin >> next;
  } else {
    c_1 = 1;
  }
  int step = 2;
  while (step < N) {
    if (step == next) {
      c_0 = 0;
      cin >> next;
    } else {
      c_0 = (c_2 + c_1) % MOD;
    }
    c_2 = c_1;
    c_1 = c_0;
    step++;
  }
  cout << (c_2 + c_1) % MOD << endl;
  return 0;
}
