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

public class Program {
    public static void Main() {
        var arr = Console.ReadLine().Split(' ').Select(t => int.Parse(t)).ToArray();
        var n = arr[0];
        var m = arr[1];

        var init = new Dictionary<int, long>();
        bool isContain1 = false;
        bool isContain2 = false;

        for (int i = 0; i < m; i++) {
            var digit = int.Parse(Console.ReadLine());
            init.Add(digit, 0);
            if (digit == 1) {
                isContain1 = true;
            } else if (digit == 2) {
                isContain2 = true;
            }
        }

        long score = Route(n, isContain1, isContain2, init) % 1000000007;
        Console.WriteLine(score);
    }

    static long Route(int step, bool isContain1, bool isContain2, Dictionary<int, long> memo) {
        if (step <= 0) {
            return 0;
        }

        long ret;
        if (memo.TryGetValue(step, out ret)) {
            return ret;
        }

        if (step == 1) {
            memo.Add(1, 1);
            return 1;
        }

        if (step == 2) {
            if (isContain1) {
                memo.Add(2, 1);
                return 1;
            }

            memo.Add(2, 2);
            return 2;
        }

        var stairMinus2 = Route(step - 2, isContain1, isContain2, memo);
        var stairMinus1 = Route(step - 1, isContain1, isContain2, memo);

        ret = stairMinus1 + stairMinus2;
        memo[step] = ret;

        return ret;
    }
}
