#include <bits/stdc++.h>
using namespace std;
int a[100005];
unsigned long long ans[100005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i];
  ans[1] = 1;
  ans[2] = 2;
  if (a[1] == 1 && a[2] == 2) {
    cout << 0;
    exit(0);
  }
  if (1 == a[1]) {
    ans[1] = 0;
    ans[2] = 1;
  }
  if (2 == a[1]) ans[2] = 0;
  for (int i = 3; i <= n; i++) {
    ans[i] = ans[i - 1] + ans[i - 2];
    for (int j = 1; j <= m; j++) {
      if (i == a[j]) ans[i] = 0;
    }
  }
  cout << ans[n] % 1000000007;
  return 0;
}
