#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long mod = 1000000007, f = 1, res = 0;
  long long ans = 1;
  cin >> n >> m;
  vector<int> a, b;
  a.push_back(0);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  a.push_back(n);
  if (m == 0) {
    for (int j = 0; j < n; j++) {
      f += res;
      res = f - res;
      if (f > mod) f %= mod;
    }
    cout << f % mod;
    return 0;
  }
  for (int i = 1; i < m + 2; i++) {
    int dist = a[i] - a[i - 1] - 2;
    if (i == 1 || i == m + 1) dist = a[i] - a[i - 1] - 1;
    if (dist < 0 && i != 1 && i != m + 1) {
      cout << 0 << endl;
      return 0;
    }
    for (int j = 0; j < dist; j++) {
      f += res;
      res = f - res;
    }
    b.push_back(f);
    f = 1;
    res = 0;
  }
  for (int i = 0; i < b.size(); i++) {
    ans *= b[i];
    if (ans > mod) ans %= mod;
  }
  cout << ans % mod;
}
