#include <bits/stdc++.h>
using namespace std;
long long broken[100005] = {0};
long long dp[100005] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  long long n, m, a;
  cin >> n;
  cin >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    broken[a] = 1;
  }
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    long long total = 0;
    if (i - 1 >= 0 && broken[i - 1] == 0) total += dp[i - 1];
    if (i - 2 >= 0 && broken[i - 2] == 0) total += dp[i - 2];
    dp[i] = total % 1000000007;
  }
  cout << dp[n] << endl;
}
