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