#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); i++) cin >> a[i];
  vector<int> dp(n + 5);
  dp[0] = 1;
  int ptr = 0;
  for (int i = 0; i < (n); i++) {
    if (m) {
      if (i == a[ptr]) {
        ptr++;
        continue;
      }
      if (i + 1 == a[ptr]) {
        if (i + 2 <= n) {
          if (i + 2 == a[ptr + 1]) {
            cout << 0 << endl;
            return 0;
          } else {
            dp[i + 2] += dp[i];
            dp[i + 2] %= mod;
          }
        }
      } else {
        dp[i + 1] += dp[i];
        dp[i + 1] %= mod;
        if (i + 2 != a[ptr] && i + 2 <= n) {
          dp[i + 2] += dp[i];
          dp[i + 2] %= mod;
        }
      }
    } else {
      dp[i + 1] += dp[i];
      dp[i + 2] += dp[i];
    }
  }
  cout << dp[n] << endl;
}
