#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, m, current;
  cin >> num >> m;
  queue<int> caution;
  for (int i = 0; i < m; i++) {
    cin >> current;
    caution.push(current);
  }
  long ans = 1;
  int how[100010] = {};
  how[0] = 1;
  how[1] = 1;
  how[2] = 2;
  for (int i = 3; i < 100005; i++) {
    how[i] = how[i - 1] + how[i - 2];
  }
  current = -1;
  while (caution.size() != 0) {
    if (caution.front() - current == 0) {
    } else if (caution.front() - current == 1) {
      ans *= 0;
    } else {
      ans *= how[caution.front() - current - 2];
    }
    current = caution.front();
    caution.pop();
    ans %= 1000000007;
  }
  if (current == num) {
    ans *= 0;
  } else {
    ans *= how[num - current - 1];
  }
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
