//129
import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    static final int MOD = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    }
} import java.io.*; io.* java import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    static final int MOD = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    }
} Main static final int MOD = 1_000_000_007; MOD 1_000_000_007 public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    } main {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in Set<Integer> broke = new HashSet<>(); broke new HashSet<>() while (m-- > 0) {
            broke.add(in.nextInt());
        } m-- > 0 m-- m 0 {
            broke.add(in.nextInt());
        } broke.add(in.nextInt()) broke.add broke in.nextInt() in.nextInt in int[] dp = new int[n + 2]; dp new int[n + 2] n + 2 n 2 if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        } broke.contains(1) && broke.contains(2) broke.contains(1) broke.contains broke 1 broke.contains(2) broke.contains broke 2 {
            out.println(0);
            out.close();
            return;
        } out.println(0) out.println out 0 out.close() out.close out return; if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        } broke.contains(1) broke.contains broke 1 {
            dp[1] = 0;
            dp[2] = 1;
        } dp[1] = 0 dp[1] dp 1 0 dp[2] = 1 dp[2] dp 2 1 if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        } broke.contains(2) broke.contains broke 2 {
            dp[1] = 1;
            dp[2] = 0;
        } dp[1] = 1 dp[1] dp 1 1 dp[2] = 0 dp[2] dp 2 0 {
            dp[1] = 1;
            dp[2] = 2;
        } dp[1] = 1 dp[1] dp 1 1 dp[2] = 2 dp[2] dp 2 2 for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        } int i=3; int i=3; i 3 i<=n i n i++ i++ i {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        } {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        } if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            } broke.contains(i - 1) && broke.contains(i - 2) broke.contains(i - 1) broke.contains broke i - 1 i 1 broke.contains(i - 2) broke.contains broke i - 2 i 2 {
                out.println(0);
                out.close();
                return;
            } out.println(0) out.println out 0 out.close() out.close out return; if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            } broke.contains(i - 1) broke.contains broke i - 1 i 1 {
                dp[i] = dp[i - 2];
            } dp[i] = dp[i - 2] dp[i] dp i dp[i - 2] dp i - 2 i 2 if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            } broke.contains(i - 2) broke.contains broke i - 2 i 2 {
                dp[i] = dp[i - 1];
            } dp[i] = dp[i - 1] dp[i] dp i dp[i - 1] dp i - 1 i 1 {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            } dp[i] = (dp[i - 1] + dp[i - 2]) % MOD dp[i] dp i (dp[i - 1] + dp[i - 2]) % MOD (dp[i - 1] + dp[i - 2]) dp[i - 1] dp i - 1 i 1 dp[i - 2] dp i - 2 i 2 MOD out.println(dp[n]) out.println out dp[n] dp n out.close() out.close out String[] args args static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    } Scanner StringTokenizer st; st BufferedReader br; br public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        } Scanner {
            br = new BufferedReader(new InputStreamReader(s));
        } br = new BufferedReader(new InputStreamReader(s)) br new BufferedReader(new InputStreamReader(s)) InputStream s s public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        } Scanner {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        } try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } FileNotFoundException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                br = new BufferedReader(new FileReader(s));
            } br = new BufferedReader(new FileReader(s)) br new BufferedReader(new FileReader(s)) String s s public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } nextLine {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } String str = ""; str "" try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                str = br.readLine();
            } str = br.readLine() str br.readLine() br.readLine br return str; str public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        } nextIntArray {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        } int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                arr[i] = nextInt();
            } {
                arr[i] = nextInt();
            } arr[i] = nextInt() arr[i] arr i nextInt() nextInt return arr; arr int n n public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        } nextDoubleArray {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        } double[] arr = new double[n]; arr new double[n] n for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                arr[i] = nextDouble();
            } {
                arr[i] = nextDouble();
            } arr[i] = nextDouble() arr[i] arr i nextDouble() nextDouble return arr; arr int n n public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        } nextLongArray {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        } long[] arr = new long[n]; arr new long[n] n for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                arr[i] = nextLong();
            } {
                arr[i] = nextLong();
            } arr[i] = nextLong() arr[i] arr i nextLong() nextLong return arr; arr int n n public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        } nextCharArray {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        } char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray(); arr nextLine().trim().replaceAll("\\s", "").toCharArray() nextLine().trim().replaceAll("\\s", "").toCharArray nextLine().trim().replaceAll("\\s", "") nextLine().trim().replaceAll nextLine().trim() nextLine().trim nextLine() nextLine "\\s" "" return arr; arr int n n public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        } nextStringArray {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        } String[] arr = new String[n]; arr new String[n] n for (int i = 0; i < n; i++) {
                arr[i] = next();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                arr[i] = next();
            } {
                arr[i] = next();
            } arr[i] = next() arr[i] arr i next() next return arr; arr int n n public class Main {
    static final int MOD = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    }
} public class Main {
    static final int MOD = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    }
} Main
//129
import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    static final int MOD = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> broke = new HashSet<>();
        while (m-- > 0) {
            broke.add(in.nextInt());
        }
        int[] dp = new int[n + 2];
        if (broke.contains(1) && broke.contains(2)) {
            out.println(0);
            out.close();
            return;
        } else if (broke.contains(1)) {
            dp[1] = 0;
            dp[2] = 1;
        } else if (broke.contains(2)) {
            dp[1] = 1;
            dp[2] = 0;
        } else {
            dp[1] = 1;
            dp[2] = 2;
        }

        for (int i=3; i<=n; i++) {
            if (broke.contains(i - 1) && broke.contains(i - 2)) {
                out.println(0);
                out.close();
                return;
            } else if (broke.contains(i - 1)) {
                dp[i] = dp[i - 2];
            } else if (broke.contains(i - 2)) {
                dp[i] = dp[i - 1];
            } else {
                dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
            }
        }
        out.println(dp[n]);
        out.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public double[] nextDoubleArray(int n) {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public char[] nextCharArray(int n) {
            char[] arr = nextLine().trim().replaceAll("\\s", "").toCharArray();
            return arr;
        }

        public String[] nextStringArray(int n) {
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = next();
            }
            return arr;
        }
    }
}
