#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  if (n == 1 || n == 0 || n == 2) {
    return n;
  } else {
    return f(n - 1) + f(n - 2);
  }
}
int main() {
  long long n, i = 0, m, s = 0;
  cin >> n >> m;
  if (m == 0) {
    s = f(n);
    s = s % 1000000007;
    printf("%lld", s);
  } else {
    long long a[m], t = 0;
    cin >> a[0];
    s = f(a[0] - 1);
    for (i = 1; i < m; i++) {
      cin >> a[i];
      if (a[i] - a[i - 1] == 1) {
        t = 1;
        s = 0;
        break;
      } else {
        if (s == 0) {
          s = s + f(a[i] - a[i - 1] - 2);
        } else {
          s = s * f(a[i] - a[i - 1] - 2);
        }
        s = s % 1000000007;
      }
    }
    if (t == 0) {
      s = s * f(n - a[m - 1] - 1);
      s = s % 1000000007;
    }
    printf("%lld", s);
  }
  return 0;
}
