#include <bits/stdc++.h>
using namespace std;
long long dp[100001] = {};
int main() {
  long long N, M, a[100001], now = 0, count = 0;
  dp[0] = 1;
  cin >> N >> M;
  for (long long i = (0); i < (M); i++) {
    cin >> a[i];
  }
  for (long long i = (0); i < (M); i++) {
    if (i > 0 && a[i] - a[i - 1] == 1) {
      dp[N] = 0;
      break;
    }
    while ((now < a[i] && now < N) || (i == M - 1 && now < N)) {
      if ((now + 2 <= N && now + 2 != a[i])) {
        if (i + 1 <= N && a[i + 1] != now + 2) {
          dp[now + 2] = (dp[now + 2] + dp[now]) % 1000000007;
        } else if (i + 1 > N) {
          dp[now + 2] = (dp[now + 2] + dp[now]) % 1000000007;
        }
      }
      if (now + 1 != a[i]) {
        if (i + 1 <= N && a[i + 1] != now + 1) {
          dp[now + 1] = (dp[now + 1] + dp[now]) % 1000000007;
        } else if (i + 1 > N) {
          dp[now + 1] = (dp[now + 1] + dp[now]) % 1000000007;
        }
      }
      now++;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
