#include <bits/stdc++.h>
using namespace std;
int fib(int x) {
  if (x == 0) {
    return 1;
  } else if (x == 1) {
    return 1;
  } else {
    return fib(x - 1) + fib(x - 2);
  }
}
int main() {
  int N, M, s, num = 0;
  long long int count = 1;
  cin >> N >> M;
  vector<int> f;
  vector<int> dif(M + 1, 0);
  cin >> s;
  f.push_back(s);
  for (int i = 1; i < M; i++) {
    cin >> s;
    f.push_back(s);
    if (f[i] - f[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = 0; i < f.size(); i++) {
    if (i == 0) {
      dif[0] = f[0] - 1;
    } else {
      dif[i] = f[i] - f[i - 1] - 2;
    }
  }
  dif[M] = N - f[M - 1] - 1;
  for (int i = 0; i < dif.size(); i++) {
    count *= fib(dif[i]);
    if (count > 1000000000 + 7) {
      count = count % 1000000007;
    }
  }
  cout << count << endl;
  return 0;
}
