#include <bits/stdc++.h>
const int MOD = 1000000007;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int(i) = 0; (i) < (m); (i)++) {
    cin >> a[i];
  }
  for (int(i) = 0; (i) < (m - 1); (i)++) {
    if (a[i] == a[i + 1] - 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long> dp(100001);
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 3; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long long ans = 1;
  ans *= dp[a[0] - 1];
  ans %= MOD;
  for (int i = 1; i < m; i++) {
    ans *= dp[a[i] - a[i - 1] - 2];
    ans %= MOD;
  }
  ans *= dp[n - a[m - 1] - 1];
  ans %= MOD;
  cout << ans << endl;
  return 0;
}
