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