using System;
using System.Collections.Generic;
using System.Linq;
#if !DEBUG
    using System.IO;
#endif


public class Program {

    public static void Main() {
        #region SetAutoFlushIsFalse
#if !DEBUG
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
#endif
        #endregion
        var nm = ReadLib.ReadAsIntArray();
        var n = nm[0];
        var m = nm[1];

        var aArr = ReadLib.ReadNTimesAsInt(m);

        memos = new Dictionary<int, ModInt>() { };
        memos.Add(0, (ModInt)1);
        memos.Add(1, (ModInt)1);
        foreach (var a in aArr) {
            if (!memos.ContainsKey(a)) {
                memos.Add(a, (ModInt)0);
            } else {
                memos[a] = (ModInt)0;
            }
        }

        for (int i = 2; i <= n; i++) {
            if (!memos.ContainsKey(i)) {
                memos.Add(i, CountRoute(i));
            }
        }

        Console.WriteLine(memos[n]);

        #region Flush
#if !DEBUG
        Console.Out.Flush();
        sw.Close();
#endif
        #endregion
    }

    private static Dictionary<int, ModInt> memos;

    private static ModInt CountRoute(int i) {
        if (memos.ContainsKey(i)) {
            return memos[i];
        }

        return CountRoute(i - 2) + CountRoute(i - 1);
    }
}

static class ReadLib {
    public static long ReadAsLong() {
        return long.Parse(Console.ReadLine());
    }

    public static int ReadAsInt() {
        return int.Parse(Console.ReadLine());
    }

    public static int[] ReadAsIntArray(int step = 0) {
        return Console.ReadLine().Split(' ').Select(s => int.Parse(s) + step).ToArray();
    }

    public static long[] ReadAsLongArray(int step = 0) {
        return Console.ReadLine().Split(' ').Select(s => long.Parse(s) + step).ToArray();
    }

    public static ulong[] ReadAsULongArray() {
        return Console.ReadLine().Split(' ').Select(s => ulong.Parse(s)).ToArray();
    }

    public static string[] ReadAsStringArray() {
        return Console.ReadLine().Split(' ');
    }

    public static int[] ReadNTimesAsInt(int n, int step = 0) {
        return Enumerable.Range(1, n).Select(s => int.Parse(Console.ReadLine()) + step).ToArray();
    }

    public static int[][] ReadNTimesAsIntArray(int n, int step = 0) {
        return Enumerable.Range(1, n).Select(s => ReadAsIntArray(step)).ToArray();
    }

}

static class MyMath {
    /// <summary>階乗</summary>
    public static long Factorial(int n) {
        if (n == 0) {
            return 1;
        }

        return Permutation(n, 0);
    }

    public static long Permutation(int n, int k) {
        return Enumerable.Range(0, n - k).Select(i => n - i).Aggregate(1, (b, i) => b * i);
    }

    /// <summary>nCr, 組み合わせ</summary>
    public static long Combination(int n, int r) {
        if (r == 0) {
            return 1;
        }
        // 分子
        var moleculeArr = Enumerable
            .Range(0, Math.Min(n - r, r))
            .Select(i => n - i)
            .ToArray();
        var moleculeArrLength = moleculeArr.Length;
        // 分母
        var denominatorArr = Enumerable
            .Range(1, Math.Max(n - r, r))
            .ToArray();

        for (var m = 0; m < moleculeArrLength; m++) {
            while (true) {
                var mVal = moleculeArr[m];
                var gcds = denominatorArr.Select(b => Gcd(mVal, b));
                var maxGcd = gcds.Max();
                var maxI = gcds.ToList().IndexOf(maxGcd);

                if (maxGcd == 1) {
                    break;
                }

                denominatorArr[maxI] /= maxGcd;
                moleculeArr[m] /= maxGcd;
            }
        }

        return FullPower(moleculeArr);
    }

    #region FullPower
    /// <summary>総乗、π</summary>
    public static long FullPower(IEnumerable<long> vs) {
        return vs.Aggregate(1L, (a, b) => a * b);
    }

    public static long FullPower(IEnumerable<int> vs) {
        return vs.Aggregate(1L, (a, b) => a * b);
    }
    #endregion

    /// <summary>最大公約数</summary>
    public static int Gcd(long item1, long item2) {
        var a = Math.Max(item1, item2);
        var b = Math.Min(item1, item2);

        while (true) {
            var mod = a % b;
            if (mod == 0) {
                break;
            }

            a = b;
            b = mod;
        }
        return (int)b;
    }

    /// <summary>約分。最大公約数で割ったものを返す。</summary>
    public static Tuple<long, long> DeviedByGcd(long item1, long item2) {
        var gcd = Gcd(item1, item2);
        return new Tuple<long, long>(item1 / gcd, item2 / gcd);
    }
}

/// <summary>あまりを計算するためのintのラッパー</summary>
struct ModInt {
    int Value { get; }
    int Mod { get; }

    public override string ToString() {
        return Value.ToString();
    }

    public static explicit operator ModInt(long value) {
        return new ModInt(value);
    }

    public ModInt(long value, int mod = 1000000007) {
        this.Value = (int)value % mod;
        this.Mod = mod;
    }

    public static explicit operator int(ModInt modInt) {
        return modInt.Value;
    }

    private static void CheckNotEqualMod(ModInt item1, ModInt item2) {
        if (item1.Mod != item2.Mod) {
            throw new Exception("mod not equal");
        }
    }

    public static ModInt operator +(ModInt item1, ModInt item2) {
        CheckNotEqualMod(item1, item2);
        long value = item1.Value + item2.Value;
        return new ModInt(value, item1.Mod);
    }

    public static ModInt operator *(ModInt item1, ModInt item2) {
        CheckNotEqualMod(item1, item2);
        long value = Math.BigMul(item1.Value, item2.Value);
        return new ModInt(value, item1.Mod);
    }

    public static ModInt operator +(ModInt item1, int item2) {
        long value = item1.Value + item2;
        return new ModInt(value, item1.Mod);
    }

    public static ModInt operator *(ModInt item1, int item2) {
        long value = Math.BigMul(item1.Value, item2);
        return new ModInt(value, item1.Mod);
    }

    public override int GetHashCode() {
        return this.Value;
    }

    public override bool Equals(object obj) {
        if (obj == null || this.GetType() != obj.GetType()) {
            return false;
        }

        var modIntObj = (ModInt)obj;
        return modIntObj.Value == this.Value;
    }

    public static bool operator ==(ModInt item1, ModInt item2) {
        return item1.Value == item2.Value;
    }

    public static bool operator !=(ModInt item1, ModInt item2) {
        return !(item1 == item2);
    }

    public static bool operator ==(ModInt item1, int item2) {
        return item1.Value == item2;
    }

    public static bool operator !=(ModInt item1, int item2) {
        return !(item1.Value == item2);
    }

    public static bool operator >=(ModInt item1, ModInt item2) {
        return item1.Value >= item2.Value;
    }

    public static bool operator <=(ModInt item1, ModInt item2) {
        return item1.Value <= item2.Value;
    }

    public static bool operator >=(ModInt item1, int item2) {
        return item1.Value >= item2;
    }

    public static bool operator <=(ModInt item1, int item2) {
        return item1.Value <= item2;
    }

    public static bool operator >(ModInt item1, ModInt item2) {
        return item1.Value > item2.Value;
    }

    public static bool operator <(ModInt item1, ModInt item2) {
        return item1.Value < item2.Value;
    }

    public static bool operator >(ModInt item1, int item2) {
        return item1.Value >= item2;
    }

    public static bool operator <(ModInt item1, int item2) {
        return item1.Value <= item2;
    }

}



Measured memory_bytes: 20832