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