#include <bits/stdc++.h>
const bool debug = false;
using namespace std;
long long n, m;
long long mod = 1000000007;
int main(void) {
  cin >> n >> m;
  long long dp[10005] = {};
  for (int(i) = 0; (i) < (m); (i)++) {
    int tmp;
    cin >> tmp;
    dp[tmp] = -1;
  }
  dp[0] = 1;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (dp[i] != -1) {
      if (dp[i + 2] != -1) {
        dp[i + 2] += dp[i];
        dp[i + 2] %= mod;
      }
      if (dp[i + 1] != -1) {
        dp[i + 1] += dp[i];
        dp[i + 1] %= mod;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
