#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll N,M;
    cin >> N >> M;
    ll a[M];

    for(ll i = 0; i < M; i++)
    {
        cin >> a[i];
        if(a[i] - a[i-1] == 1)
        {
            cout << 0 << endl;
            return 0;
        }
    }

    ll dp[N+1] = {0};
    
    if(a[0] == 1)
        {
            dp[1] = 0;
            dp[2] = 1;
        }
        else if(a[0] == 2)
        {
            dp[1] = 1;
            dp[2] = 0;
        }
        else
        {
            dp[1] = 1;
            dp[2] = 2;
        }
    
    for(ll i = 1; i < M; i++)
    {
        dp[a[i]] = -1;
    }

    for(ll i = 3; i <= N; i++)
    {
        if(dp[i] != -1)
        {
            dp[i] = dp[i-1] + dp[i-2];
        }
        else
        {
            dp[i] = 0;
        }
        dp[i] %= 1000000007;
    }
    cout << dp[N] << endl;
}


 
