#include <bits/stdc++.h>
using namespace std;
long long N = 1000000007;
int main() {
  long long dp[100000] = {0};
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i < 100000; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    if (dp[i] > N) {
      dp[i] %= N;
    }
  }
  int n, m;
  cin >> n >> m;
  vector<long long> a(m);
  vector<long long> b(m + 1);
  vector<long long> c(m + 1);
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    long long temp;
    cin >> temp;
    a.at(i) = temp;
    if (i > 0 && a.at(i - 1) + 1 == a.at(i)) {
      cout << 0 << endl;
      return 0;
    }
    if (i == 0 && a.at(i) != 0)
      b.at(i) = a.at(i);
    else if (i != 0)
      b.at(i) = a.at(i) - a.at(i - 1) - 1;
    else if (a.at(i) == 0)
      b.at(i) = 1;
  }
  b.at(m) = n - a.at(m - 1);
  for (int i = 0; i < m + 1; i++) {
    c.at(i) = dp[b.at(i)];
    ans *= c.at(i);
  }
  if (ans > N) ans %= N;
  cout << ans << endl;
  return 0;
}
