#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void add_self(long long &a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
}
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  long long dp[100005];
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    dp[x] = -1;
  }
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (dp[i] == -1)
      dp[i] = 0;
    else if (i == 1)
      dp[i] = dp[i - 1];
    else {
      add_self(dp[i], dp[i - 1] + dp[i - 2]);
    }
  }
  cout << dp[n];
}
