#include <bits/stdc++.h>
int step(int n, int i, int m, int *ans, int *a) {
  if (i == -1)
    return 0;
  else if (i == 0)
    return 1;
  else if (ans[i] != -1)
    return ans[i];
  else {
    for (int j = 0; j < m; j++) {
      if (a[j] == i) {
        ans[i] = 0;
        return 0;
      }
    }
    ans[i] =
        (step(n, i - 1, m, ans, a) + step(n, i - 2, m, ans, a)) % 1000000007;
  }
  return ans[i];
}
int main() {
  int n, m, ans[100001], a[100001];
  scanf("%d%d\n", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n + 1; i++) {
    ans[i] = -1;
  }
  printf("%d\n", step(n, n, m, ans, a));
  return 0;
}
