#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1000000007;
vector<long long> dp(100000 + 1);
void solve() {
  long long n, m;
  cin >> n >> m;
  dp.resize(n + 1);
  dp[0] = 1;
  dp[1] = 1;
  vector<bool> broken(n + 1);
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    broken[a] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (broken[i] == -1)
      dp[i] = 0;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % MAX;
  }
  cout << dp[n] << endl;
}
int main() {
  solve();
  return 0;
}
