#include <bits/stdc++.h>
using namespace std;
long fibo(int n) {
  long f1 = 1, f2 = 1;
  for (int i = 1; i < n; i++) {
    f1 = f1 + f2;
    swap(f1, f2);
  }
  return f1;
}
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<int> b(m + 1);
  if (m == 0) {
    b[0] = n + 1;
  } else {
    b[0] = a[0];
    for (int i = 1; i < m; i++) {
      b[i] = a[i] - a[i - 1] - 1;
      if (b[i] == 0) {
        cout << 0 << endl;
        return 0;
      }
    }
    b[m] = n - a[m - 1];
  }
  long result = 1;
  for (int i = 0; i < m + 1; i++) {
    result = (result * fibo(b[i])) % 1000000007;
  }
  cout << result << endl;
}
