#include <bits/stdc++.h>
using namespace std;
vector<bool> stairs_table(10100);
vector<long long int> dp(10100);
int main() {
  for (int i = 0; i < 10100; i++) {
    stairs_table.at(i) = true;
    dp[i] = 0;
  }
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
    stairs_table.at(a.at(i)) = false;
  }
  dp[0] = 1;
  for (int i = 0; i + 1 <= n; i++) {
    if (stairs_table.at(i)) dp[i + 1] += dp[i];
    if (stairs_table.at(i)) dp[i + 2] += dp[i];
  }
  cout << dp[n] % 1000000007 << endl;
}
