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