#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long mod = 998244353;
int inf = 1000001000;
long long INF = 1e18 + 5;
int f(int n) {
  if (n == -1) return 1;
  if (n == -2) return 0;
  int a = 1, b = 0, temp;
  for (int(i) = 0; (i) < (n); (i)++) {
    temp = b % MOD;
    b = a % MOD;
    a = (a + temp) % MOD;
  }
  return (a + b) % MOD;
}
int main() {
  int n, m, me = -1, ans = 1;
  cin >> n >> m;
  for (int(i) = 0; (i) < (m); (i)++) {
    int s;
    cin >> s;
    ans = (ans * f(s - me - 3)) % MOD;
    me = s;
  }
  cout << (ans * f(n - me - 2)) % MOD << endl;
}
