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