#include <bits/stdc++.h>
using namespace std;
long int ss(long int n) {
  if (n == 1)
    return 1;
  else if (n == 2)
    return 2;
  else
    return ss(n - 1) + ss(n - 2);
}
int main() {
  long int n, m, a, b;
  cin >> n >> m;
  long long int s = 1;
  for (int j = 0; j < m + 1; j++) {
    long int k;
    b = a;
    if (j != m) cin >> a;
    if (j == 0) {
      k = a - 1;
      if (k < 1) k = 1;
    } else if (j == m) {
      k = n - b - 1;
      if (k < 1) k - 1;
    } else {
      k = a - b - 2;
      if (k < 0) {
        cout << 0 << endl;
        return 0;
      }
    }
    s = s * ss(k) % 1000000007;
  }
  cout << s << endl;
  return 0;
}
