using System;
using System.IO;
using System.Linq;

class Solve {
    static void Main(string[] args) {
        var arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int N = arr[0], M = arr[1];
        var brk = new int[M];
        for (int i = 0; i < M; i++) {
            brk[i] = int.Parse(Console.ReadLine());
        }
        var dp = new long[N + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (brk.Any()) {
            var index = 0;
            if (brk[index] == 1) {
                dp[1] = 0;
                index++;
            }
            for (int i = 2; i <= N; i++) {
                if (index < M && i == brk[index]) {
                    index++;
                    continue;
                }
                dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
            }
        }
        var answer = dp[^1];
        var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(writer);
        Console.WriteLine(answer);
        Console.Out.Flush();
    }
}