#include <bits/stdc++.h>
using namespace std;
long long fib(long long n) {
  if (n <= 2) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> H(m);
  for (long long i = 0; i < m; i++) {
    cin >> H[i];
  }
  vector<long long> G(m + 1);
  long long ans;
  ans = 1;
  G[0] = H[0];
  G[m] = n - H[m - 1] + 1;
  bool conti;
  conti = true;
  if (m > 1) {
    for (long long i = 1; i < m; i++) {
      G[i] = H[i] - H[i - 1];
      if (G[i] == 1) {
        ans = 0;
        conti = false;
      }
    }
  }
  if (conti) {
    for (long long i = 0; i < m + 1; i++) {
      ans = ans * fib(G[i] - 1);
      if (ans > 1000000007) {
        ans = ans % 1000000007;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
