#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include<algorithm>

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef unsigned long long ll;


int main()
{
    ll N,M,res;

    cin >> N >> M;

    ll tmp;

    vector <ll> koware(M + 2);
    vector <ll> kumi(N + 2);

    kumi[0] = 0;
    kumi[1] = 1;
    kumi[2] = 1;
    for(ll j = 3; j <= N + 1; j++)
    {
        kumi[j] = kumi[j-1] + kumi[j-2];
    }
    koware[0] = -1;

    for(ll j = 1; j <= M; j++)
    {
        cin >> koware[j];

    }
    koware[M+1] = N+1;

    res = 1;
    ll tmp;

    //1つめだけ別の解法
    
    for(ll j = 0; j <= M; j++)
    {
        res *= kumi[(koware[j+1] - koware[j] - 1)];

        if(res > 1000000007)
        {
            tmp = res / 1000000007;
            res -= 1000000007 * tmp;
        }
    }

    res = res % 1000000007;
    cout << res << endl;

}

