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