
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Set;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author EndUser
 * 
 */
public class Main {
        
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    }
    
    private static int findLocation(String[] p, int begin, int end, int position, char c) {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    }
    
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }

} import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.InputMismatchException; InputMismatchException java.util import java.util.Set; Set java.util public class Main {
        
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    }
    
    private static int findLocation(String[] p, int begin, int end, int position, char c) {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    }
    
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }

} Main public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    } main {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    } InputReader in = new InputReader(System.in); in new InputReader(System.in) PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true); pw new PrintWriter(new BufferedOutputStream(System.out), true) int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in int[] bs = new int[m]; bs new int[m] m for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            bs[i] = in.nextInt();
        } {
            bs[i] = in.nextInt();
        } bs[i] = in.nextInt() bs[i] bs i in.nextInt() in.nextInt in int[] f = new int[n + 1]; f new int[n + 1] n + 1 n 1 f[0] = 1 f[0] f 0 1 int bsi = 0; bsi 0 if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        } m > 0 && bs[0] == 1 m > 0 m 0 bs[0] == 1 bs[0] bs 0 1 {
            bsi++;
            f[1] = 0;
        } bsi++ bsi f[1] = 0 f[1] f 1 0 {
            f[1] = 1;
        } f[1] = 1 f[1] f 1 1 boolean impossible = false; impossible false for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        } {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        } if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            } bsi < m && bs[bsi] == i bsi < m bsi m bs[bsi] == i bs[bsi] bs bsi i {
                f[i] = 0;
                bsi++;
            } f[i] = 0 f[i] f i 0 bsi++ bsi {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            } f[i] = (f[i-1] + f[i-2]) % 1000000007 f[i] f i (f[i-1] + f[i-2]) % 1000000007 (f[i-1] + f[i-2]) f[i-1] f i-1 i 1 f[i-2] f i-2 i 2 1000000007 if (f[i] == 0) {
                    impossible = true;
                    break;
                } f[i] == 0 f[i] f i 0 {
                    impossible = true;
                    break;
                } impossible = true impossible true break; if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        } impossible {
            pw.println(0);
        } pw.println(0) pw.println pw 0 {
            pw.println(f[n]);
        } pw.println(f[n]) pw.println pw f[n] f n pw.close() pw.close pw String[] args args private static int findLocation(String[] p, int begin, int end, int position, char c) {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    } findLocation {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    } int result = -1; result -1 1 while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        } begin < end begin end {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        } int mid = begin + (end - begin) / 2; mid begin + (end - begin) / 2 begin (end - begin) / 2 (end - begin) end begin 2 char x = p[mid].charAt(position); x p[mid].charAt(position) p[mid].charAt p[mid] p mid position if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            } x >= c x c {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } if (x == c) {
                    result = mid;
                } x == c x c {
                    result = mid;
                } result = mid result mid end = mid end mid {
                begin = mid + 1;
            } begin = mid + 1 begin mid + 1 mid 1 return result; result String[] p p int begin begin int end end int position position char c c static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    } InputReader private final InputStream stream; stream private final byte[] buf = new byte[8192]; buf new byte[8192] 8192 private int curChar curChar snumChars; snumChars private SpaceCharFilter filter; filter public InputReader(InputStream stream) {
            this.stream = stream;
        } InputReader {
            this.stream = stream;
        } this.stream = stream this.stream this this.stream stream InputStream stream stream public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        } snext {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        } if (snumChars == -1) {
                throw new InputMismatchException();
            } snumChars == -1 snumChars -1 1 {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            } curChar >= snumChars curChar snumChars {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            } curChar = 0 curChar 0 try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                } catch (IOException e) {
                    throw new InputMismatchException();
                } IOException e {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() {
                    snumChars = stream.read(buf);
                } snumChars = stream.read(buf) snumChars stream.read(buf) stream.read stream buf if (snumChars <= 0) {
                    return -1;
                } snumChars <= 0 snumChars 0 {
                    return -1;
                } return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        } nextInt {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        } int c = snext(); c snext() snext while (isSpaceChar(c)) {
                c = snext();
            } isSpaceChar(c) isSpaceChar c {
                c = snext();
            } c = snext() c snext() snext int sgn = 1; sgn 1 if (c == '-') {
                sgn = -1;
                c = snext();
            } c == '-' c '-' {
                sgn = -1;
                c = snext();
            } sgn = -1 sgn -1 1 c = snext() c snext() snext int res = 0; res 0 do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                } c < '0' || c > '9' c < '0' c '0' c > '9' c '9' {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = snext() c snext() snext return res * sgn; res * sgn res sgn public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        } nextLong {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        } int c = snext(); c snext() snext while (isSpaceChar(c)) {
                c = snext();
            } isSpaceChar(c) isSpaceChar c {
                c = snext();
            } c = snext() c snext() snext int sgn = 1; sgn 1 if (c == '-') {
                sgn = -1;
                c = snext();
            } c == '-' c '-' {
                sgn = -1;
                c = snext();
            } sgn = -1 sgn -1 1 c = snext() c snext() snext long res = 0; res 0 do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                } c < '0' || c > '9' c < '0' c '0' c > '9' c '9' {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = snext() c snext() snext return res * sgn; res * sgn res sgn public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        } nextIntArray {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        } int a[] = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = nextInt();
            } {
                a[i] = nextInt();
            } a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        } readString {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        } int c = snext(); c snext() snext while (isSpaceChar(c)) {
                c = snext();
            } isSpaceChar(c) isSpaceChar c {
                c = snext();
            } c = snext() c snext() snext StringBuilder res = new StringBuilder(); res new StringBuilder() do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                res.appendCodePoint(c);
                c = snext();
            } res.appendCodePoint(c) res.appendCodePoint res c c = snext() c snext() snext return res.toString(); res.toString() res.toString res public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        } nextLine {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        } int c = snext(); c snext() snext while (isSpaceChar(c)) {
                c = snext();
            } isSpaceChar(c) isSpaceChar c {
                c = snext();
            } c = snext() c snext() snext StringBuilder res = new StringBuilder(); res new StringBuilder() do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c)); !isEndOfLine(c) isEndOfLine(c) isEndOfLine c {
                res.appendCodePoint(c);
                c = snext();
            } res.appendCodePoint(c) res.appendCodePoint res c c = snext() c snext() snext return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        } isSpaceChar {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        } if (filter != null) {
                return filter.isSpaceChar(c);
            } filter != null filter null {
                return filter.isSpaceChar(c);
            } return filter.isSpaceChar(c); filter.isSpaceChar(c) filter.isSpaceChar filter c return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        } isEndOfLine {
            return c == '\n' || c == '\r' || c == -1;
        } return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        } SpaceCharFilter public boolean isSpaceChar(int ch); isSpaceChar int ch ch public class Main {
        
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    }
    
    private static int findLocation(String[] p, int begin, int end, int position, char c) {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    }
    
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }

} public class Main {
        
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    }
    
    private static int findLocation(String[] p, int begin, int end, int position, char c) {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    }
    
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }

} Main

import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Set;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author EndUser
 * 
 */
public class Main {
        
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out), true);

        int n = in.nextInt();
        int m = in.nextInt();
        int[] bs = new int[m];
        for (int i = 0; i < m; i++) {
            bs[i] = in.nextInt();
        }
        
        int[] f = new int[n + 1];
        f[0] = 1;
        int bsi = 0;
        if (m > 0 && bs[0] == 1) {
            bsi++;
            f[1] = 0;
        } else {
            f[1] = 1;
        }
        
        boolean impossible = false;
        for (int i = 2; i <= n; i++) {
            if (bsi < m && bs[bsi] == i) {
                f[i] = 0;
                bsi++;
            } else {
                f[i] = (f[i-1] + f[i-2]) % 1000000007;
                if (f[i] == 0) {
                    impossible = true;
                    break;
                }
            }
        }
        
        if (impossible) {
            pw.println(0);
        } else {
            pw.println(f[n]);
        }
        
        pw.close();
    }
    
    private static int findLocation(String[] p, int begin, int end, int position, char c) {
        int result = -1;
        while (begin < end) {
            int mid = begin + (end - begin) / 2;
            char x = p[mid].charAt(position);
            if (x >= c) {
                if (x == c) {
                    result = mid;
                }
                end = mid;
            } else {
                begin = mid + 1;
            }
        }
        
        return result;
    }
    
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }

}
