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