#include <bits/stdc++.h>
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int ny, nx;
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
long long llpow(long long x, long long y) {
  long long ans = 1;
  for (int i = 0, i_len = (y); i < i_len; ++i) ans *= x;
  return ans;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
class UnionFind {
 public:
  vector<long long> par;
  vector<long long> siz;
  UnionFind(long long sz_) : par(sz_), siz(sz_, 1LL) {
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  void init(long long sz_) {
    siz.assign(sz_, 1LL);
    par.resize(sz_);
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  long long root(long long x) {
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }
  bool merge(long long x, long long y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }
  bool issame(long long x, long long y) { return root(x) == root(y); }
  long long size(long long x) { return siz[root(x)]; }
};
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
struct fibonacci {
  using value_type = std::size_t;
  std::vector<value_type> memo = {0, 1};
  value_type operator()(value_type value) {
    if (memo.size() > value && (memo[value] || value == 0)) {
      return memo[value];
    }
    memo.resize(value + 1, 0);
    value_type result = (*this)(value - 2) + (*this)(value - 1);
    memo[value] = result;
    return result;
  }
};
int main() {
  fibonacci fib;
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0, i_len = (M); i < i_len; ++i) {
    cin >> a[i];
  }
  long long ans = 1, res = 1;
  bool flag = false;
  for (int i = (1); i < (N + 1); ++i) {
    int cnt = 0;
    for (int j = 0, j_len = (M); j < j_len; ++j) {
      if (i != a[j]) {
        cnt++;
      }
    }
    if (cnt == M)
      res++;
    else {
      ans *= fib(res);
      ans = ans % 1000000007;
      res = 0;
      flag = true;
    }
  }
  ans *= fib(res);
  cout << ans % 1000000007 << endl;
  return 0;
}
