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