#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;
int main(void) {
  ull mod = 1000000007;
  uint N, M;
  cin >> N >> M;
  queue<uint> aq;
  for (uint i = 0; i < M; i++) {
    uint a;
    cin >> a;
    if (!aq.empty() && (a - 1) == aq.back()) {
      cout << 0;
      return 0;
    } else {
      aq.push(a);
    }
  }
  ull dp_2 = 1;
  ull dp_1;
  if (!aq.empty() && aq.front() == 1) {
    dp_1 = 0;
    aq.pop();
  } else {
    dp_1 = 1;
  }
  ull dp;
  for (uint i = 2; i <= N; i++) {
    if (!aq.empty() && aq.front() == i) {
      dp = 0;
      aq.pop();
    } else {
      dp = (dp_1 + dp_2) % mod;
    }
    dp_2 = dp_1;
    dp_1 = dp;
  }
  cout << dp;
  return 0;
}
