#include <bits/stdc++.h>
using namespace std;
int fibo(int x) {
  if (x == 0 || x == 1)
    return 1;
  else
    return (fibo(x - 1) + fibo(x - 2));
}
int main() {
  long long a = 10, b, c = 0, d, e, f, g = 1, n, i, j, k = 0, m = 0, sum = 3000;
  int hh[100010] = {};
  cin >> n >> m;
  hh[n + 1] = 1;
  for (i = 0; i < m; i++) {
    cin >> b;
    hh[b] = 1;
    if (hh[b - 1] == 1 && hh[b] == 1) k = 1;
  }
  if (k == 1)
    cout << 0;
  else {
    for (i = 0; i < n + 2; i++) {
      if (hh[i] == 0)
        c++;
      else {
        e = fibo(c - 1);
        g = g * e;
        c = 0;
      }
    }
    cout << g % 1000000007;
  }
  return 0;
}
