#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double pi = 3.14159265358979323846;
const int inf = 1e9;
const long long INF = 1e18;
int main() {
  cin.tie(0), cout.tie(0);
  ios::sync_with_stdio(false);
  long long n, m, a, dp[100005] = {};
  cin >> n >> m;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a;
    mp[a]++;
  }
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (!mp[i - 1]) {
      dp[i] += dp[i - 1];
      dp[i] %= MOD;
    }
    if (i != 1 && !mp[i - 2]) {
      dp[i] += dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << dp[n] << endl;
}
