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