#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, *a, *d, i, x, memo, sum = 0;
  cin >> N >> M;
  a = new int[M];
  d = new int[N];
  d[0] = 1;
  if (N > 2) {
    d[1] = 1;
    d[2] = 2;
  } else {
    if (N == 2) {
      d[1] = 1;
    }
  }
  for (i = 0; i < M; i++) {
    cin >> a[i];
    if (i != 0) {
      if (a[i] - a[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      } else {
        x = a[i] - a[i - 1] - 2;
        if (x > memo) {
          for (int j = memo + 1; j <= x; j++) {
            d[j] = d[j - 1] + d[j - 2];
            d[j] %= 1000000007;
          }
          memo = x;
        }
        int tmp = sum;
        for (int j = 1; j < d[x]; j++) {
          sum += tmp;
          sum %= 1000000007;
        }
      }
    } else {
      memo = a[0] - 1;
      if (memo > 2) {
        for (int j = 3; j <= memo; j++) {
          d[j] = d[j - 1] + d[j - 2];
          d[j] %= 1000000007;
        }
      }
      sum += d[memo];
    }
  }
  x = N - a[M - 1] - 1;
  if (x > memo) {
    for (int j = memo + 1; j <= x; j++) {
      d[j] = d[j - 1] + d[j - 2];
      d[j] %= 1000000007;
    }
    memo = x;
  }
  int tmp = sum;
  for (int j = 1; j < d[x]; j++) {
    sum += tmp;
    sum %= 1000000007;
  }
  cout << sum << endl;
  return 0;
}
