using System;
using System.Linq;
using System.Collections.Generic;

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var _ = Console.ReadLine().Split();
            var n = int.Parse(_[0]);
            var m = int.Parse(_[1]);

            var a = new List<int>();
            for(var i = 0; i < m; i++){
                var t = int.Parse(Console.ReadLine());
                a.Add(t);
            }

            memo[0] = 1;
            memo[1] = 1;
            var count = fib(n, a);
            Console.WriteLine(count % 1000000007);
        }

        static long[] memo = new long[1000001];
        static long fib(int n, List<int> a){
            if(a.Contains(n)){
                return 0;
            }
            if(memo[n] != 0){
                return memo[n];
            }
            memo[n] = fib(n-1, a) + fib(n-2, a);
            return memo[n];
        }
    }
}
