#include <bits/stdc++.h>
using namespace std;
int f(int n) {
  if (n == 1) return 1;
  if (n == 2) return 1;
  return f(n - 1) + f(n - 2);
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[m + 1], d[m + 1];
  a[0] = 0;
  for (int i = 1; i < m + 1; i++) {
    cin >> a[i];
    d[i - 1] = a[i] - a[i - 1] - 1;
    if (d[i - 1] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  d[m] = n - a[m];
  long long c = 1;
  for (int i = 0; i < m + 1; i++) {
    c *= f(d[i]);
  }
  c %= 1000000007;
  cout << c << endl;
}
