#include <bits/stdc++.h>
using namespace std;
long long n, m, ans = 1;
long long f[100005];
void fib() {
  f[1] = 1;
  for (long long i = 2; i <= 100000; ++i)
    f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
}
long long solve() {
  cin >> n >> m;
  fib();
  long long b[m + 2];
  b[0] = -1;
  for (long long i = 1; i <= m; ++i) cin >> b[i];
  b[m + 1] = n + 1;
  for (long long i = 1; i <= m + 1; ++i) {
    long long s = b[i] - b[i - 1] - 1;
    ans = ans * f[s] % 1000000007;
  }
  cout << ans;
  return 0;
}
signed main() {
  ios::sync_with_stdio(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
