#include <bits/stdc++.h>
using namespace std;
long long int a = 0, b = 0, c = 0, d = 0, e = 0, ans = 0, x = 0, y = 0, z = 0,
              n = 0, m = 0, maxy = 0, mini = 9999, counter = 0, endp = 0,
              checker = 0;
std::vector<long long int> vec{}, vecsec{}, vecth{};
long long int iremono[100001], koware[100001];
long long int iremono2[100001], check[100001], xpo[10000001], ypo[10000001],
    hei[1000001];
std::vector<std::string> kinds{}, kaku{};
char maze[1000][1000];
int sx, sy;
int gx, gy;
vector<pair<long long int, long long int>> pairs;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
bool okada = false, okada2 = false;
std::string output, output2, input, input2;
char re;
int starta, startb, enda, endb, ab;
unsigned long long int LCM(unsigned long long int a, unsigned long long int b) {
  unsigned long long int i, j;
  i = a;
  j = b;
  while (true) {
    c = i % j;
    i = j;
    if (c != 0) {
      j = c;
    } else {
      break;
    }
  }
  return j * (a / j) * (b / j);
}
int kaizyo(int k) {
  int sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
int H, W;
bool qw = false, er = false, ty = false, ui = false;
int main() {
  cin >> a >> b;
  iremono[0] = 1;
  iremono[1] = 1;
  for (int i = 2; i <= a; i++) {
    iremono[i] = (iremono[i - 1] + iremono[i - 2]) % 1000000007;
  }
  for (long long i = 0; i < b; i++) {
    cin >> koware[i];
    if (i != 0) {
      vec.push_back(koware[i] - koware[i - 1] - 2);
      if (koware[i + 1] - koware[i] == 1) {
        cout << 0 << endl;
        return 0;
      }
    } else {
      vec.push_back(koware[i] - 1);
    }
  }
  vec.push_back(a - koware[b - 1] - 1);
  ans = 1;
  for (long long i = 0; i < vec.size(); i++) {
    ans = ans * iremono[vec[i]] % 1000000007;
  }
  cout << ans << endl;
}
