#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vec = std::vector<T>;
using vi = vec<int>;
using vvi = vec<vi>;
using pii = std::pair<int, int>;
using ll = long long;
using vll = vec<ll>;
using ld = long double;
template <typename T>
void putv(vector<T> &V) {
  for (auto x : V) cout << x << " ";
  cout << endl;
}
template <class T>
vector<T> getv(int n) {
  vector<T> vec;
  for (int i = (0); i < int(n); ++i) {
    T input;
    cin >> input;
    vec.emplace_back(input);
  }
  return vec;
}
using Weight = ll;
using Flow = int;
struct Edge {
  int src, dst;
  Weight weight;
  Flow cap;
  Edge() : src(0), dst(0), weight(0) {}
  Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;
void add_edge(Graph &g, int a, int b, Weight w = 1) {
  g[a].emplace_back(a, b, w);
  g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int a, int b, Weight w = 1) {
  g[a].emplace_back(a, b, w);
}
void init_weighted_graph(Graph &g, int N, int M) {
  vector<Edge> empty_Edges;
  g = Graph(N, empty_Edges);
  for (int i = (0); i < int(M); ++i) {
    int a, b, w;
    cin >> a >> b >> w;
    add_edge(g, a - 1, b - 1, w);
  }
}
void init_weighted_directed_graph(Graph &g, int N, int M) {
  vector<Edge> empty_Edges;
  g = Graph(N, empty_Edges);
  for (int i = (0); i < int(M); ++i) {
    int a, b, w;
    cin >> a >> b >> w;
    add_arc(g, a - 1, b - 1, w);
  }
}
void show_weighted_graph(const Graph &g) {
  int N = g.size();
  int M = 0;
  for (int s = (0); s < int(N); ++s) M += g[s].size();
  cout << "///////////////////////" << endl;
  cout << "The Adjacency List of" << endl
       << "G=(V,E) (n=" << N << ","
       << "m=" << M << ")" << endl;
  for (int s = (0); s < int(N); ++s) {
    cout << s << ": ";
    int size = g[s].size();
    for (int t = (0); t < int(size); ++t)
      cout << "(" << g[s][t].dst << "," << g[s][t].weight << ")";
    cout << endl;
  }
  cout << "////////////////////////" << endl << endl;
}
bool is_adj(Graph &g, int a, int b) {
  for (auto e : g[a])
    if (b == e.dst) return true;
  return false;
}
Matrix warshallFloyd(const Graph &g) {
  auto const inf = numeric_limits<Weight>::max() / 8;
  int n = g.size();
  Matrix d(n, Array(n, inf));
  for (int i = (0); i < int(n); ++i) d[i][i] = 0;
  for (int i = (0); i < int(n); ++i)
    for (auto &e : g[i]) d[e.src][e.dst] = min(d[e.src][e.dst], e.weight);
  for (int k = (0); k < int(n); ++k)
    for (int i = (0); i < int(n); ++i)
      for (int j = (0); j < int(n); ++j)
        if (d[i][k] != inf && d[k][j] != inf)
          d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  return d;
}
void out(bool ans) {
  if (ans == true)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
}
void Out(bool ans) {
  if (ans == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
void OUT(bool ans) {
  if (ans == true)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
ll gcd(const ll a, const ll b) { return (b == 0) ? a : gcd(b, a % b); }
ll lcm(const ll a, const ll b) { return a * (b / gcd(a, b)); }
ll Manhattan_dist(ll x1, ll y1, ll x2, ll y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}
ll hmt_p_divides_n(ll p, ll n) {
  ll s = 0;
  while (n % p == 0) {
    n /= p;
    s++;
  }
  return s;
}
int digit(ll n) {
  int cntr = 0;
  while (n > 0) {
    n /= 10;
    cntr++;
  }
  return cntr;
}
template <class T>
T gabs(const T &x) {
  return max(x, -x);
}
ll memo[100][100] = {};
ll binom(const int n, const int r) {
  if (n < r) return 0;
  if (r == 0 || n == r) return 1;
  if (memo[n][r] > 0)
    return memo[n][r];
  else
    return memo[n][r] = binom(n - 1, r) + binom(n - 1, r - 1);
}
ll pw(ll x, int y) {
  ll a = 1;
  while (y) {
    if (y & 1) a = (a * x) % 1000000007;
    x = (x * x) % 1000000007;
    y >>= 1;
  }
  return a;
}
ll modinv(ll x) { return pw(x, 1000000007 - 2); }
bool is_prime(int p) {
  if (p <= 1) return false;
  for (int n = 2; n <= pow(p, 0.5); ++n)
    if (p % n == 0) return false;
  return true;
}
int max_prime_divisor(int n) {
  for (int x = n; x > 1; --x)
    if (is_prime(x) && n % x == 0) return x;
  return -1;
}
vi factorize(int n) {
  vi factors;
  while (n > 1) {
    int p = max_prime_divisor(n);
    factors.emplace_back(p);
    n /= p;
  }
  sort(factors.begin(), factors.end());
  putv(factors);
  return factors;
}
ll f(ll b, ll n) {
  if (n < b) return n;
  return f(b, n / b) + n % b;
}
void field_table(int p) {
  cout << "MOD = " << p << endl << endl;
  cout << " + | ";
  for (int a = 0; a <= p - 1; ++a)
    cout << std::setfill('0') << std::right << std::setw(2) << a << " ";
  cout << endl;
  cout << "----";
  for (int i = 0; i < p; ++i) cout << "---";
  cout << endl;
  for (int a = 0; a <= p - 1; ++a) {
    cout << std::setfill('0') << std::right << std::setw(2) << a << " | ";
    for (int b = 0; b <= p - 1; ++b)
      cout << std::setfill('0') << std::right << std::setw(2) << (a + b) % p
           << " ";
    cout << endl;
  }
  cout << endl << " * | ";
  for (int a = 1; a <= p - 1; ++a)
    cout << std::setfill('0') << std::right << std::setw(2) << a << " ";
  cout << endl;
  cout << "----";
  for (int i = 0; i < p - 1; ++i) cout << "---";
  cout << endl;
  for (int a = 1; a <= p - 1; ++a) {
    cout << std::setfill('0') << std::right << std::setw(2) << a << " | ";
    for (int b = 1; b <= p - 1; ++b)
      cout << std::setfill('0') << std::right << std::setw(2) << (a * b) % p
           << " ";
    cout << endl;
  }
}
int minus_inverse(int p, int n) {
  int a = p - n;
  for (int b = 1; b < p; ++b)
    if ((a * b) % p == 1) return b;
  return -1;
}
int inverse(int p, int n) {
  int a = 1;
  while ((n * a) % p != 1) a++;
  return a;
}
int inverse_minus_inverese(int p, int n) {
  int a = inverse(p, n);
  return inverse(p, p - a);
}
ll fib_memo[100000];
ll fib(int n) {
  if (n == 0 || n == 1) return 1;
  if (fib_memo[n] > 0)
    return fib_memo[n];
  else
    fib_memo[n] = fib(n - 1) + fib(n - 2);
  return fib_memo[n];
}
int main() {
  int mo = 1000000007;
  fib_memo[0] = 1;
  fib_memo[1] = 1;
  int n, m;
  cin >> n >> m;
  int a[m];
  int pos = 0;
  ll ret = 1;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    if (a[i] == a[i - 1] + 1) {
      ret = 0;
      break;
    }
    ret = (ret * fib(a[i] - pos - 1)) % mo;
    pos = a[i] + 1;
  }
  ret = (ret * fib(n - pos)) % mo;
  cout << ret << endl;
}
