#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  bool is_valid = true;
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
    if (i > 0 && a[i] - a[i - 1] == 1) {
      is_valid = false;
    }
  }
  if (!is_valid) {
    cout << 0 << endl;
    return 0;
  }
  int start = 0;
  long long ans = 1;
  for (int i = 0; i < M; ++i) {
    int range = a[i] - start;
    if (range > 2) {
      vector<long long> befores(2);
      befores[0] = 1;
      befores[1] = 1;
      for (int j = 3; j <= range; ++j) {
        long long n = (befores[0] + befores[1]) % MOD;
        befores[0] = befores[1];
        befores[1] = n;
      }
      ans = ans * befores[1] % MOD;
    }
    start = a[i] + 1;
  }
  if (a[M - 1] < N) {
    int range = N - a[M - 1];
    if (range > 2) {
      vector<long long> befores(2);
      befores[0] = 1;
      befores[1] = 1;
      for (int j = 3; j <= range; ++j) {
        long long n = (befores[0] + befores[1]) % MOD;
        befores[0] = befores[1];
        befores[1] = n;
      }
      ans = ans * befores[1] % MOD;
    }
  }
  cout << ans << endl;
  return 0;
}
