#include <bits/stdc++.h>
const long long LINF = 1e18;
const int INF = 1e8;
using namespace std;
long long fibNum[100002] = {};
long long fib(int);
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  fib(n);
  vector<int> a(m + 1);
  a[0] = -1;
  bool bl = true;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
    if (a[i] - a[i - 1] == 1) {
      bl = false;
    }
  }
  if (bl) {
    a.push_back(n + 1);
    for (int i = 0; i <= n + 1; i++) {
      fibNum[i] = 0;
    }
    fibNum[0] = 1;
    fibNum[1] = 1;
    long long cnt = 1;
    long long tmp = 0;
    for (int i = 1; i <= m + 1; i++) {
      tmp = fib(a[i] - a[i - 1] - 2);
      cnt *= tmp;
      cnt %= 1000000007;
    }
    cout << cnt << endl;
  } else {
    cout << 0 << endl;
  }
}
long long fib(int x) {
  if (x == 0) {
    return 1;
  } else if (x == 1) {
    return 1;
  } else if (fibNum[x] != 0) {
    return fibNum[x];
  }
  fibNum[x] = fib(x - 1) + fib(x - 2);
  return fibNum[x];
}
