#include <bits/stdc++.h>
using namespace std;
int way_stair(int tile) {
  if (tile <= 0)
    return 0;
  else if (tile == 1)
    return 1;
  else
    return way_stair(tile - 1) + way_stair(tile - 2);
}
int main() {
  int n, m, kekka = 1;
  cin >> n >> m;
  vector<int> broken(m + 2);
  broken.at(0) = -1;
  for (int i = 1; i < m + 1; i++) cin >> broken.at(i);
  broken.at(m + 1) = n + 1;
  for (int i = 0; i < m + 1; i++)
    kekka *= way_stair(broken.at(i + 1) - broken.at(i) - 1);
  cout << kekka % 1000000007 << endl;
}
