#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m;
  cin >> n >> m;
  long d[n + 10];
  d[0] = 0;
  d[1] = 1;
  d[2] = 2;
  for (int i = 3; i <= n; i++) {
    d[i] = d[i - 1] + d[i - 2];
  }
  long a[n + 10];
  a[0] = 0;
  a[m + 1] = n + 1;
  long ans = 1;
  for (int i = 1; i <= m + 1; i++) {
    cin >> a[i];
    long t = a[i] - a[i - 1] - 2;
    if (i == 1 && t <= 0)
      t = 1;
    else if (i == 1)
      t++;
    if (t == -1) t = 0;
    ans *= d[t];
    ans %= 1000000007;
  }
  cout << ans << endl;
}
