#include <bits/stdc++.h>
using namespace std;
int n, m;
int tag[100003], ans[100003];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int t;
    scanf("%d", &t);
    tag[t] = 1;
  }
  if (tag[1] == 0) ans[1] = 1;
  if (tag[2] == 0) ans[2] = 1;
  for (int i = 2; i <= n; i++) {
    if (tag[i] == 0) ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007;
  }
  cout << ans[n];
  return 0;
}
