#include <bits/stdc++.h>
using namespace std;
int n, m;
int broken[100000 + 5];
queue<long long> que;
long long mem[100000 + 5];
long long plan(int x) {
  if (mem[x] == 0) {
    for (int i = 3; i <= x; ++i) {
      mem[i] = mem[i - 1] + mem[i - 2];
    }
  }
  return mem[x] % 1000000007;
}
int main(int argc, char *argv[]) {
  mem[1] = 1;
  mem[2] = 2;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> broken[i];
  }
  int pos = 0;
  for (int i = 0; i < m; ++i) {
    if (pos == broken[i]) {
      cout << 0 << endl;
      return 0;
    }
    int dist = broken[i] - 1 - pos;
    if (dist > 0) {
      que.emplace(plan(dist));
      pos = broken[i] + 1;
    } else {
      pos += 2;
    }
  }
  if (n - pos > 0) {
    que.emplace(plan(n - pos));
  }
  long long result = 1;
  while (!que.empty()) {
    result *= que.front();
    result %= 1000000007;
    que.pop();
  }
  cout << result % 1000000007 << endl;
}
