using System;
using System.Collections.Generic;
using System.IO;

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