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