#include <bits/stdc++.h>
using namespace std;
long long level;
struct edge {
  long long to;
};
vector<edge> G[100010];
long long d[100010];
bool cmp(const pair<long long, long long> &a,
         const pair<long long, long long> &b) {
  if (a.second == b.second)
    return a.first < b.first;
  else
    return a.second > b.second;
}
void dfs(int root, vector<long long> &c) {
  d[root] = c[level];
  level--;
  for (auto itr = G[root].begin(); itr != G[root].end(); ++itr) {
    if (d[itr->to] == 0) dfs(itr->to, c);
  }
  return;
}
int main(void) {
  long long n, m;
  cin >> n >> m;
  vector<long long> w(m);
  long long ans = 0;
  for (long long i = 0; i < m; i++) cin >> w[i];
  long long dp[100010] = {0};
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  for (long long i = 3; i <= n; i++)
    dp[i] = (dp[i - 1] % (1000000000 + 7) + dp[i - 2] % (1000000000 + 7)) %
            (1000000000 + 7);
  if (w[0] == 1)
    ans = 1;
  else
    ans = (dp[w[0] - 1]) % (1000000000 + 7);
  for (long long i = 1; i < m; i++) {
    if (w[i] - w[i - 1] - 1 <= 0)
      ans = ans * 0;
    else {
      if (w[i] - w[i - 1] - 1 == 1)
        ans = ans * 1;
      else {
        ans = (ans * (dp[w[i] - w[i - 1] - 2]) % (1000000000 + 7)) %
              (1000000000 + 7);
      }
    }
  }
  if (n - w[m - 1] > 1)
    ans = (ans * (dp[n - w[m - 1] - 1]) % (1000000000 + 7)) % (1000000000 + 7);
  cout << ans << endl;
  return 0;
}
