#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void disp(int n, int* ans) {
  cout << n << ": (" << ans[0] << ", " << ans[1] << ", " << ans[2] << ")\n";
}
int main() {
  int N, M;
  cin >> N >> M;
  int ans[] = {0, 0, 1};
  int n = 0;
  for (int m = 0; m < M; m++) {
    int a;
    cin >> a;
    for (; n < a; n++) {
      ans[0] = ans[1];
      ans[1] = ans[2];
      ans[2] = (ans[0] + ans[1]) % mod;
      disp(n, ans);
    }
    ans[2] = 0;
  }
  for (; n < N; n++) {
    ans[0] = ans[1];
    ans[1] = ans[2];
    ans[2] = (ans[0] + ans[1]) % mod;
    disp(n, ans);
  }
  cout << ans[2] << endl;
  cin >> ans[2];
  return 0;
}
