#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  scanf("%d", &n);
  scanf("%d", &m);
  int a[m];
  int x[n + 2];
  x[0] = 0;
  x[1] = 1;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    x[a[i] + 1] = 0;
  }
  int j = 0;
  for (int i = 2; i < n + 2; i++) {
    if (a[j] == i - 1) {
      j++;
    } else {
      x[i] = (x[i - 1] + x[i - 2]) % 1000000007;
    }
  }
  printf("%d", x[n + 1]);
}
