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