#include <bits/stdc++.h>
using namespace std;
int Count(int target);
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> stair(m + 1);
  stair[0] = 0;
  for (int is = 1; is < m + 1; is++) {
    cin >> stair[is];
  }
  stair.emplace_back(n);
  int count = Count(stair[1] - 1);
  for (int i = 1; i < m; i++) {
    count *= Count(stair[i + 1] - stair[i] - 2);
  }
  count *= Count(stair[m + 1] - stair[m] - 1);
  count = count % 1000000007;
  cout << count << endl;
}
int Count(int target) {
  if (target == -1) return 0;
  if (target == 1 || target == 0) return 1;
  if (target == 2) return 2;
  if (target > 2) {
    vector<int> way(target);
    way[0] = 1;
    way[1] = 2;
    for (int iw = 2; iw < target; iw++) {
      way[iw] = way[iw - 1] + way[iw - 2];
    }
    return way[target - 1];
  }
}
