#include <bits/stdc++.h>
using namespace std;
struct Interval {
  int start, end;
};
bool compare(Interval i1, Interval i2) { return (i1.start < i2.start); }
long long int mod = 1e9 + 7;
long long int fib[100005] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i <= (100005); ++i) fib[i] = fib[i - 1] + fib[i - 2];
  long long int n, m;
  cin >> n >> m;
  long long int a[m];
  for (long long int i = 0; i < (m); ++i) cin >> a[i];
  sort(a, a + m);
  for (int i = 1; i <= (m - 1); ++i) {
    if (a[i] - a[i - 1] == 1 || a[i] == n) {
      cout << 0;
      return 0;
    }
  }
  long long int diff[m + 1];
  diff[0] = a[0] - 1;
  for (int i = 1; i <= (m - 1); ++i) {
    diff[i] = a[i] - a[i - 1] - 2;
  }
  diff[m] = n + 1 - a[m - 1] - 2;
  long long int ans = 1;
  for (long long int i = 0; i < (m + 1); ++i) {
    ans = (ans * (fib[diff[i]] % mod)) % mod;
  }
  cout << ans;
  return 0;
}
