#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e+17;
const long long MODcdf = 998244353;
const long long MODatc = 1000000007;
bool pairCompare(const pair<string, long long>& firstElof,
                 const pair<string, long long>& secondElof) {
  return firstElof.first < secondElof.first;
}
bool pairCompare2(pair<string, long long> firstElof,
                  pair<string, long long> secondElof) {
  return (firstElof.second) % 1000 > (secondElof.second) % 1000;
}
bool less_mod1000(int lhs, int rhs) {
  if ((lhs - rhs) % 1000 != 0)
    return lhs % 1000 < rhs % 1000;
  else
    return lhs < rhs;
}
string A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string a = "abcdefghijklmnopqrstuvwxyz";
long long dp[100000];
long long jump(long long start, long long goal) {
  if (dp[start] >= 0) return dp[start];
  if (start == goal) {
    return 1;
  } else if (start > goal) {
    return 0;
  }
  return dp[start] = jump(start + 1, goal) + jump(start + 2, goal);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  for (long long i = 0; i < 100000; i++) dp[i] = -1;
  long long n, m;
  cin >> n >> m;
  long long a[m];
  for (long long i = 1; i < m + 1; i++) cin >> a[i];
  long long sum[m + 1];
  for (long long i = 0; i < m + 1; i++) {
    if (i == 0)
      sum[i] = jump(0, a[i + 1] - 1);
    else if (i < m)
      sum[i] = jump(a[i] + 1, a[i + 1] - 1);
    else
      sum[i] = jump(a[i] + 1, n);
  }
  long long ans = 1;
  for (long long i = 0; i < m + 1; i++) {
    ans *= sum[i];
    ans %= MODatc;
  }
  cout << ans << endl;
}
