#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
long long gcd(long long x, long long y) {
  if (x % y == 0) return y;
  return gcd(y, x % y);
}
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<long long> dp(n + 1);
  for (int i = 0; i < (int)m; ++i) {
    int a;
    cin >> a;
    dp[a] = -1;
  }
  if (dp[1] == -1) {
    dp[1] = 0;
    dp[2] = 1;
  } else if (dp[2] == -1) {
    dp[1] = 1;
    dp[2] = 0;
  } else {
    dp[1] = 1;
    dp[2] = 2;
  }
  for (int i = 3; i < (int)n + 1; ++i) {
    if (dp[i] == -1)
      dp[i] = 0;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % INF;
  }
  cout << dp[n] << endl;
  return 0;
}
