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