#include <bits/stdc++.h>
using namespace std;
long long dp[1000];
long long MOD{1000000007};
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<int> broken(100010, 0);
  int x;
  for (int i = 0; i < m; i++) {
    cin >> x;
    broken[x] = 1;
  }
  dp[0] = 1;
  for (int num = 0; num < n; num++) {
    for (int next = num + 1; next <= min(num + 2, n); next++) {
      if (not broken[next]) {
        dp[next] += dp[num];
        dp[next] = dp[next] % 1000000007;
      } else
        dp[next] = 0;
    }
  }
  cout << dp[n];
}
