#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m, t = 0, k = 1, l = 0, h = 0, ans = 1, u = 1, v = 2, w = 1;
  cin >> n >> m;
  vector<int> a(m + 1);
  vector<int> b(0);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
  }
  while (true) {
    if (k == a.at(l)) {
      if (t == 1) {
        cout << 0 << endl;
        return 0;
      }
      b.push_back(h);
      h = -1;
      t = 1;
      l++;
    } else {
      t = 0;
      h++;
    }
    if (k == n) break;
    k++;
  }
  b.push_back(h);
  for (int i = 0; i < b.size(); i++) {
    for (int j = 2; j < b.at(i); j++) {
      w = u + v;
      u = v;
      v = w;
    }
    if (b.at(i) == 2)
      ans = ans * 2;
    else
      ans = ans * w % 1000000007;
    u = 1;
    v = 2;
    w = 1;
  }
  cout << ans << endl;
}
