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