#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 + 1);
  dp[0] = 1;
  int ptr = 0;
  int ptr1 = 0;
  for (int i = 0; i < (n); i++) {
    if (i == a[ptr]) {
      ptr++;
      continue;
    }
    if (i + 1 == a[ptr1]) {
      ptr1++;
      if (i + 2 == a[ptr1]) {
        cout << 0 << endl;
      } else {
        dp[i + 2] += dp[i];
        dp[i + 2] %= mod;
      }
    } else {
      dp[i + 1] += dp[i];
      dp[i + 1] %= mod;
      if (i + 2 == a[ptr1]) {
        ptr1++;
      } else {
        dp[i + 2] += dp[i];
        dp[i + 2] %= mod;
      }
    }
  }
  cout << dp[n] << endl;
}
