#include <bits/stdc++.h>
using namespace std;
long func(long n) {
  long current = 0;
  long next = 1;
  for (int i = 0; i < n; i++) {
    long tmp = current;
    current = next;
    next += tmp;
  }
  return current;
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[M];
  int i;
  for (i = 0; i < M; i++) {
    cin >> a[i];
  }
  long cnt = 0;
  int plus = 0;
  if (a[0] == 1 || a[M - 1] == N - 1) {
    plus += 1;
  }
  if (M > 1) {
    for (i = 0; i < M - 1; i++) {
      if (a[i] + 1 == a[i + 1]) {
        cout << cnt << endl;
        return 0;
      }
      if (a[i] + 2 == a[i + 1]) {
        plus += 1;
      }
    }
  }
  cnt = func(N);
  cnt -= 4 * M;
  cnt += plus;
  cout << cnt % 1000000007 << endl;
  return 0;
}
