using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Pipes;

namespace cswork
{
    class Program
    {
        public Program() { }

        Scanner cin;
        const int MAXIN = 1024;
        bool[] used = new bool[MAXIN];
        int[] perm = new int[MAXIN];

        List<int[]> permList = new List<int[]>();

        void Omame()
        {
            cin = new Scanner();
            int n = cin.nextInt();
            int m = cin.nextInt();
            HashSet<int> a = new HashSet<int>();
            for (int i = 0; i < m; i++)
            {
                a.Add(cin.nextInt()-1);
            }

            long[] count = new long[n];
            if (a.Contains(0))
            {
                count[0] = 0;
            }
            else
            {
                count[0] = 1;
            }

            if (a.Contains(1))
            {
                count[1] = 0;
            }
            else
            {
                count[1] = count[0] + 1;
            }

            for (int i = 2; i < n; i++)
            {
                if (a.Contains(i))
                {
                    count[i] = 0;
                }
                else
                {
                    count[i] = count[i - 1] + count[i - 2];
                }
            }

            Console.WriteLine(count[n - 1] % 1000000007);
        }

        static void Main(string[] args)
        {
            new Program().Omame();
        }

        public void Permutation(int pos, int n, int length)
        {
            if (pos == n)
            {
                permList.Add((int[])perm.Clone());
            }

            for (int i = 0; i < n; i++)
            {
                if (!used[i])
                {
                    perm[pos] = i;
                    used[i] = true;
                    Permutation(pos + 1, n, length);
                    used[i] = false;
                }
            }
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();

            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next();
        }

        public int nextInt()
        {
            return int.Parse(next());
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }
    }
}