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