import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int mod = 998244353;
            int n = in.nextInt();
            int k = in.nextInt();
            int[] v = new int[10];
            for (int i = 0; i < k; i++) {
                int x = in.nextInt();
                v[x] = 1;
            }
            int[] ans = {1};
            int p = n / 2;
            while (true) {
                if (p % 2 != 0) {
                    ans = multiplyMod(ans, v, mod);
                }
                p /= 2;
                v = multiplyMod(v, v, mod);
                if (p == 0) break;
            }
            int res = 0;
            for (int x : ans) {
                res = (int) ((res + (long) x * x) % mod);
            }
            out.println(res);
        }

        static int[] multiplyMod(int[] a, int[] b, int mod) {
            int need = a.length + b.length - 1;
            int n = Math.max(2, Integer.highestOneBit(need - 1) << 1);

            double[] aReal = new double[n];
            double[] aImaginary = new double[n];
            for (int i = 0; i < a.length; i++) {
                int x = (a[i] % mod + mod) % mod;
                aReal[i] = x & ((1 << 15) - 1);
                aImaginary[i] = x >> 15;
            }
            fft(aReal, aImaginary, false);

            double[] bReal = new double[n];
            double[] bImaginary = new double[n];
            for (int i = 0; i < b.length; i++) {
                int x = (b[i] % mod + mod) % mod;
                bReal[i] = x & ((1 << 15) - 1);
                bImaginary[i] = x >> 15;
            }
            fft(bReal, bImaginary, false);

            double[] faReal = new double[n];
            double[] faImaginary = new double[n];
            double[] fbReal = new double[n];
            double[] fbImaginary = new double[n];

            for (int i = 0; i < n; i++) {
                int j = (n - i) & (n - 1);

                double a1r = (aReal[i] + aReal[j]) / 2;
                double a1i = (aImaginary[i] - aImaginary[j]) / 2;
                double a2r = (aImaginary[i] + aImaginary[j]) / 2;
                double a2i = (aReal[j] - aReal[i]) / 2;

                double b1r = (bReal[i] + bReal[j]) / 2;
                double b1i = (bImaginary[i] - bImaginary[j]) / 2;
                double b2r = (bImaginary[i] + bImaginary[j]) / 2;
                double b2i = (bReal[j] - bReal[i]) / 2;

                faReal[i] = a1r * b1r - a1i * b1i - a2r * b2i - a2i * b2r;
                faImaginary[i] = a1r * b1i + a1i * b1r + a2r * b2r - a2i * b2i;

                fbReal[i] = a1r * b2r - a1i * b2i + a2r * b1r - a2i * b1i;
                fbImaginary[i] = a1r * b2i + a1i * b2r + a2r * b1i + a2i * b1r;
            }

            fft(faReal, faImaginary, true);
            fft(fbReal, fbImaginary, true);
            int[] res = new int[need];
            for (int i = 0; i < need; i++) {
                long aa = (long) (faReal[i] + 0.5);
                long bb = (long) (fbReal[i] + 0.5);
                long cc = (long) (faImaginary[i] + 0.5);
                res[i] = (int) ((aa + ((bb % mod) << 15) + ((cc % mod) << 30)) % mod);
            }
            return res;
        }

        static void fft(double[] a, double[] b, boolean inverse) {
            int n = a.length;
            int shift = 32 - Integer.numberOfTrailingZeros(n);
            for (int i = 1; i < n; i++) {
                int j = Integer.reverse(i << shift);
                if (i < j) {
                    double temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                    temp = b[i];
                    b[i] = b[j];
                    b[j] = temp;
                }
            }
            for (int len = 2; len <= n; len <<= 1) {
                int halfLen = len >> 1;
                double[] cs = new double[halfLen];
                double[] sn = new double[halfLen];
                for (int i = 0; i < halfLen; i++) {
                    cs[i] = Math.cos(2 * Math.PI * i / len * (inverse ? -1 : 1));
                    sn[i] = Math.sin(2 * Math.PI * i / len * (inverse ? -1 : 1));
                }
                for (int i = 0; i < n; i += len) {
                    for (int j = 0; j < halfLen; j++) {
                        double wA = cs[j];
                        double wB = sn[j];
                        double uA = a[i + j];
                        double uB = b[i + j];
                        double vA = a[i + j + halfLen] * wA - b[i + j + halfLen] * wB;
                        double vB = a[i + j + halfLen] * wB + b[i + j + halfLen] * wA;
                        a[i + j] = uA + vA;
                        b[i + j] = uB + vB;
                        a[i + j + halfLen] = uA - vA;
                        b[i + j + halfLen] = uB - vB;
                    }
                }
            }
            if (inverse) {
                for (int i = 0; i < n; i++) {
                    a[i] /= n;
                    b[i] /= n;
                }
            }
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buf = new byte[1024];
        int pos;
        int size;

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

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

        int read() {
            if (size == -1)
                throw new InputMismatchException();
            if (pos >= size) {
                pos = 0;
                try {
                    size = is.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (size <= 0)
                    return -1;
            }
            return buf[pos++] & 255;
        }

        static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


//package educational.round57;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class G {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = ni();
		int K = ni();
		int[] d = na(K);
		long[] f = new long[20];
		for(int i = 0;i < K;i++){
			for(int j = 0;j < K;j++){
				f[10+d[i]-d[j]]++;
			}
		}

		n /= 2;
		long[] g = new long[1];
		g[0] = 1;
		for(int D = 17;D >= 0;D--){
			g = clean(convoluteSimply(g, g, mod, 3));
			if(n<<~D<0){
				g = clean(mulnaive(g, f));
			}
		}
		out.println(n*10 < g.length ? g[n*10] : 0);
	}

	long[] clean(long[] a)
	{
		for(int i = a.length-1;i >= 0;i--){
			if(a[i] != 0){
				if(i == a.length-1)return a;
				return Arrays.copyOf(a, i+1);
			}
		}
		return new long[0];
	}

	public static long[] mulnaive(long[] a, long[] b)
	{
		long[] c = new long[a.length+b.length-1];
		long big = 8L*mod*mod;
		for(int i = 0;i < a.length;i++){
			for(int j = 0;j < b.length;j++){
				c[i+j] += a[i]*b[j];
				if(c[i+j] >= big)c[i+j] -= big;
			}
		}
		for(int i = 0;i < c.length;i++)c[i] %= mod;
		return c;
	}

	static int mod = 998244353;

	public static final int[] NTTPrimes = {1053818881, 1051721729, 1045430273, 1012924417, 1007681537, 1004535809, 998244353, 985661441, 976224257, 975175681};
	public static final int[] NTTPrimitiveRoots = {7, 6, 3, 5, 3, 3, 3, 3, 3, 17};
//	public static final int[] NTTPrimes = {1012924417, 1004535809, 998244353, 985661441, 975175681, 962592769, 950009857, 943718401, 935329793, 924844033};
//	public static final int[] NTTPrimitiveRoots = {5, 3, 3, 3, 17, 7, 7, 7, 3, 5};

	public static long[] convoluteSimply(long[] a, long[] b, int P, int g)
	{
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length)-1)<<2);
		long[] fa = nttmb(a, m, false, P, g);
		long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
		for(int i = 0;i < m;i++){
			fa[i] = fa[i]*fb[i]%P;
		}
		return nttmb(fa, m, true, P, g);
	}

	public static long[] convolute(long[] a, long[] b)
	{
		int USE = 2;
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length)-1)<<2);
		long[][] fs = new long[USE][];
		for(int k = 0;k < USE;k++){
			int P = NTTPrimes[k], g = NTTPrimitiveRoots[k];
			long[] fa = nttmb(a, m, false, P, g);
			long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
			for(int i = 0;i < m;i++){
				fa[i] = fa[i]*fb[i]%P;
			}
			fs[k] = nttmb(fa, m, true, P, g);
		}

		int[] mods = Arrays.copyOf(NTTPrimes, USE);
		long[] gammas = garnerPrepare(mods);
		int[] buf = new int[USE];
		for(int i = 0;i < fs[0].length;i++){
			for(int j = 0;j < USE;j++)buf[j] = (int)fs[j][i];
			long[] res = garnerBatch(buf, mods, gammas);
			long ret = 0;
			for(int j = res.length-1;j >= 0;j--)ret = ret * mods[j] + res[j];
			fs[0][i] = ret;
		}
		return fs[0];
	}

	public static long[] convolute(long[] a, long[] b, int USE, int mod)
	{
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length)-1)<<2);
		long[][] fs = new long[USE][];
		for(int k = 0;k < USE;k++){
			int P = NTTPrimes[k], g = NTTPrimitiveRoots[k];
			long[] fa = nttmb(a, m, false, P, g);
			long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
			for(int i = 0;i < m;i++){
				fa[i] = fa[i]*fb[i]%P;
			}
			fs[k] = nttmb(fa, m, true, P, g);
		}

		int[] mods = Arrays.copyOf(NTTPrimes, USE);
		long[] gammas = garnerPrepare(mods);
		int[] buf = new int[USE];
		for(int i = 0;i < fs[0].length;i++){
			for(int j = 0;j < USE;j++)buf[j] = (int)fs[j][i];
			long[] res = garnerBatch(buf, mods, gammas);
			long ret = 0;
			for(int j = res.length-1;j >= 0;j--)ret = (ret * mods[j] + res[j]) % mod;
			fs[0][i] = ret;
		}
		return fs[0];
	}

	// static int[] wws = new int[270000]; // outer faster

	// Modifed Montgomery + Barrett
	private static long[] nttmb(long[] src, int n, boolean inverse, int P, int g)
	{
		long[] dst = Arrays.copyOf(src, n);

		int h = Integer.numberOfTrailingZeros(n);
		long K = Integer.highestOneBit(P)<<1;
		int H = Long.numberOfTrailingZeros(K)*2;
		long M = K*K/P;

		int[] wws = new int[1<<h-1];
		long dw = inverse ? pow(g, P-1-(P-1)/n, P) : pow(g, (P-1)/n, P);
		long w = (1L<<32)%P;
		for(int k = 0;k < 1<<h-1;k++){
			wws[k] = (int)w;
			w = modh(w*dw, M, H, P);
		}
		long J = invl(P, 1L<<32);
		for(int i = 0;i < h;i++){
			for(int j = 0;j < 1<<i;j++){
				for(int k = 0, s = j<<h-i, t = s|1<<h-i-1;k < 1<<h-i-1;k++,s++,t++){
					long u = (dst[s] - dst[t] + 2*P)*wws[k];
					dst[s] += dst[t];
					if(dst[s] >= 2*P)dst[s] -= 2*P;
//					long Q = (u&(1L<<32)-1)*J&(1L<<32)-1;
					long Q = (u<<32)*J>>>32;
					dst[t] = (u>>>32)-(Q*P>>>32)+P;
				}
			}
			if(i < h-1){
				for(int k = 0;k < 1<<h-i-2;k++)wws[k] = wws[k*2];
			}
		}
		for(int i = 0;i < n;i++){
			if(dst[i] >= P)dst[i] -= P;
		}
		for(int i = 0;i < n;i++){
			int rev = Integer.reverse(i)>>>-h;
			if(i < rev){
				long d = dst[i]; dst[i] = dst[rev]; dst[rev] = d;
			}
		}

		if(inverse){
			long in = invl(n, P);
			for(int i = 0;i < n;i++)dst[i] = modh(dst[i]*in, M, H, P);
		}

		return dst;
	}

	// Modified Shoup + Barrett
	private static long[] nttsb(long[] src, int n, boolean inverse, int P, int g)
	{
		long[] dst = Arrays.copyOf(src, n);

		int h = Integer.numberOfTrailingZeros(n);
		long K = Integer.highestOneBit(P)<<1;
		int H = Long.numberOfTrailingZeros(K)*2;
		long M = K*K/P;

		long dw = inverse ? pow(g, P-1-(P-1)/n, P) : pow(g, (P-1)/n, P);
		long[] wws = new long[1<<h-1];
		long[] ws = new long[1<<h-1];
		long w = 1;
		for(int k = 0;k < 1<<h-1;k++){
			wws[k] = (w<<32)/P;
			ws[k] = w;
			w = modh(w*dw, M, H, P);
		}
		for(int i = 0;i < h;i++){
			for(int j = 0;j < 1<<i;j++){
				for(int k = 0, s = j<<h-i, t = s|1<<h-i-1;k < 1<<h-i-1;k++,s++,t++){
					long ndsts = dst[s] + dst[t];
					if(ndsts >= 2*P)ndsts -= 2*P;
					long T = dst[s] - dst[t] + 2*P;
					long Q = wws[k]*T>>>32;
					dst[s] = ndsts;
					dst[t] = ws[k]*T-Q*P&(1L<<32)-1;
				}
			}
//			dw = dw * dw % P;
			if(i < h-1){
				for(int k = 0;k < 1<<h-i-2;k++){
					wws[k] = wws[k*2];
					ws[k] = ws[k*2];
				}
			}
		}
		for(int i = 0;i < n;i++){
			if(dst[i] >= P)dst[i] -= P;
		}
		for(int i = 0;i < n;i++){
			int rev = Integer.reverse(i)>>>-h;
			if(i < rev){
				long d = dst[i]; dst[i] = dst[rev]; dst[rev] = d;
			}
		}

		if(inverse){
			long in = invl(n, P);
			for(int i = 0;i < n;i++){
				dst[i] = modh(dst[i] * in, M, H, P);
			}
		}

		return dst;
	}

	static final long mask = (1L<<31)-1;

	public static long modh(long a, long M, int h, int mod)
	{
		long r = a-((M*(a&mask)>>>31)+M*(a>>>31)>>>h-31)*mod;
		return r < mod ? r : r-mod;
	}

	private static long[] garnerPrepare(int[] m)
	{
		int n = m.length;
		assert n == m.length;
		if(n == 0)return new long[0];
		long[] gamma = new long[n];
		for(int k = 1;k < n;k++){
			long prod = 1;
			for(int i = 0;i < k;i++){
				prod = prod * m[i] % m[k];
			}
			gamma[k] = invl(prod, m[k]);
		}
		return gamma;
	}

	private static long[] garnerBatch(int[] u, int[] m, long[] gamma)
	{
		int n = u.length;
		assert n == m.length;
		long[] v = new long[n];
		v[0] = u[0];
		for(int k = 1;k < n;k++){
			long temp = v[k-1];
			for(int j = k-2;j >= 0;j--){
				temp = (temp * m[j] + v[j]) % m[k];
			}
			v[k] = (u[k] - temp) * gamma[k] % m[k];
			if(v[k] < 0)v[k] += m[k];
		}
		return v;
	}

	private static long pow(long a, long n, long mod) {
		//		a %= mod;
		long ret = 1;
		int x = 63 - Long.numberOfLeadingZeros(n);
		for (; x >= 0; x--) {
			ret = ret * ret % mod;
			if (n << 63 - x < 0)
				ret = ret * a % mod;
		}
		return ret;
	}

	private static long invl(long a, long mod) {
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		return p < 0 ? p + mod : p;
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new G().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG {
        static double[] cs = new double[1 << 21];
        static double[] sn = new double[1 << 21];
        static double[] csi = new double[1 << 21];
        static double[] sni = new double[1 << 21];

        static {
            for (int i = 0; i < cs.length; i++) {
                cs[i] = Math.cos(2 * Math.PI * i / cs.length);
                sn[i] = Math.sin(2 * Math.PI * i / cs.length);
                csi[i] = Math.cos(-2 * Math.PI * i / cs.length);
                sni[i] = Math.sin(-2 * Math.PI * i / cs.length);
            }
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int mod = 998244353;
            int n = in.nextInt();
            int k = in.nextInt();
            int[] v = new int[10];
            for (int i = 0; i < k; i++) {
                int x = in.nextInt();
                v[x] = 1;
            }
            int[] ans = {1};
            int p = n / 2;
            while (true) {
                if (p % 2 != 0) {
                    ans = multiplyMod(ans, v, mod);
                }
                p /= 2;
                if (p == 0) break;
                v = multiplyMod(v, v, mod);
            }
            int res = 0;
            for (int x : ans) {
                res = (int) ((res + (long) x * x) % mod);
            }
            out.println(res);
        }

        static int[] multiplyMod(int[] a, int[] b, int mod) {
            int need = a.length + b.length - 1;
            int n = Math.max(2, Integer.highestOneBit(need - 1) << 1);

            double[] aReal = new double[n];
            double[] aImaginary = new double[n];
            for (int i = 0; i < a.length; i++) {
                int x = (a[i] % mod + mod) % mod;
                aReal[i] = x & ((1 << 15) - 1);
                aImaginary[i] = x >> 15;
            }
            fft(aReal, aImaginary, false);

            double[] bReal = new double[n];
            double[] bImaginary = new double[n];
            for (int i = 0; i < b.length; i++) {
                int x = (b[i] % mod + mod) % mod;
                bReal[i] = x & ((1 << 15) - 1);
                bImaginary[i] = x >> 15;
            }
            fft(bReal, bImaginary, false);

            double[] faReal = new double[n];
            double[] faImaginary = new double[n];
            double[] fbReal = new double[n];
            double[] fbImaginary = new double[n];

            for (int i = 0; i < n; i++) {
                int j = (n - i) & (n - 1);

                double a1r = (aReal[i] + aReal[j]) / 2;
                double a1i = (aImaginary[i] - aImaginary[j]) / 2;
                double a2r = (aImaginary[i] + aImaginary[j]) / 2;
                double a2i = (aReal[j] - aReal[i]) / 2;

                double b1r = (bReal[i] + bReal[j]) / 2;
                double b1i = (bImaginary[i] - bImaginary[j]) / 2;
                double b2r = (bImaginary[i] + bImaginary[j]) / 2;
                double b2i = (bReal[j] - bReal[i]) / 2;

                faReal[i] = a1r * b1r - a1i * b1i - a2r * b2i - a2i * b2r;
                faImaginary[i] = a1r * b1i + a1i * b1r + a2r * b2r - a2i * b2i;

                fbReal[i] = a1r * b2r - a1i * b2i + a2r * b1r - a2i * b1i;
                fbImaginary[i] = a1r * b2i + a1i * b2r + a2r * b1i + a2i * b1r;
            }

            fft(faReal, faImaginary, true);
            fft(fbReal, fbImaginary, true);
            int[] res = new int[need];
            for (int i = 0; i < need; i++) {
                long aa = (long) (faReal[i] + 0.5);
                long bb = (long) (fbReal[i] + 0.5);
                long cc = (long) (faImaginary[i] + 0.5);
                res[i] = (int) ((aa + ((bb % mod) << 15) + ((cc % mod) << 30)) % mod);
            }
            return res;
        }

        static void fft(double[] a, double[] b, boolean inverse) {
            int n = a.length;
            int shift = 32 - Integer.numberOfTrailingZeros(n);
            for (int i = 1; i < n; i++) {
                int j = Integer.reverse(i << shift);
                if (i < j) {
                    double temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                    temp = b[i];
                    b[i] = b[j];
                    b[j] = temp;
                }
            }
            for (int len = 2; len <= n; len <<= 1) {
                int halfLen = len >> 1;
                for (int i = 0; i < n; i += len) {
                    int w = cs.length / len;
                    for (int j = 0, k = 0; j < halfLen; j++, k += w) {
                        double wA = inverse ? csi[k] : cs[k];
                        double wB = inverse ? sni[k] : sn[k];
                        double uA = a[i + j];
                        double uB = b[i + j];
                        double vA = a[i + j + halfLen] * wA - b[i + j + halfLen] * wB;
                        double vB = a[i + j + halfLen] * wB + b[i + j + halfLen] * wA;
                        a[i + j] = uA + vA;
                        b[i + j] = uB + vB;
                        a[i + j + halfLen] = uA - vA;
                        b[i + j + halfLen] = uB - vB;
                    }
                }
            }
            if (inverse) {
                for (int i = 0; i < n; i++) {
                    a[i] /= n;
                    b[i] /= n;
                }
            }
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buf = new byte[1024];
        int pos;
        int size;

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

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

        int read() {
            if (size == -1)
                throw new InputMismatchException();
            if (pos >= size) {
                pos = 0;
                try {
                    size = is.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (size <= 0)
                    return -1;
            }
            return buf[pos++] & 255;
        }

        static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class G1096 {
	public static final int[] NTTPrimes = {1053818881, 1051721729, 1045430273, 1012924417, 1007681537, 1004535809, 998244353, 985661441, 976224257, 975175681};
	public static final int[] NTTPrimitiveRoots = {7, 6, 3, 5, 3, 3, 3, 3, 3, 17};
//	public static final int[] NTTPrimes = {1012924417, 1004535809, 998244353, 985661441, 975175681, 962592769, 950009857, 943718401, 935329793, 924844033};
//	public static final int[] NTTPrimitiveRoots = {5, 3, 3, 3, 17, 7, 7, 7, 3, 5};

	public static long[] convoluteSimply(long[] a, long[] b, int P, int g) {
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2);
		long[] fa = nttmb(a, m, false, P, g);
		long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
		for (int i = 0; i < m; i++) {
			fa[i] = fa[i] * fb[i] % P;
		}
		return nttmb(fa, m, true, P, g);
	}

	public static long[] convolute(long[] a, long[] b) {
		int USE = 2;
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2);
		long[][] fs = new long[USE][];
		for (int k = 0; k < USE; k++) {
			int P = NTTPrimes[k], g = NTTPrimitiveRoots[k];
			long[] fa = nttmb(a, m, false, P, g);
			long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
			for (int i = 0; i < m; i++) {
				fa[i] = fa[i] * fb[i] % P;
			}
			fs[k] = nttmb(fa, m, true, P, g);
		}

		int[] mods = Arrays.copyOf(NTTPrimes, USE);
		long[] gammas = garnerPrepare(mods);
		int[] buf = new int[USE];
		for (int i = 0; i < fs[0].length; i++) {
			for (int j = 0; j < USE; j++) {
				buf[j] = (int) fs[j][i];
			}
			long[] res = garnerBatch(buf, mods, gammas);
			long ret = 0;
			for (int j = res.length - 1; j >= 0; j--) {
				ret = ret * mods[j] + res[j];
			}
			fs[0][i] = ret;
		}
		return fs[0];
	}

	public static long[] convolute1(long[] a, long[] b) {
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2);
		int P = NTTPrimes[0], g = NTTPrimitiveRoots[0];
		long[] fa = nttmb(a, m, false, P, g);
		long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
		for (int i = 0; i < m; i++) {
			fa[i] = fa[i] * fb[i] % P;
		}
		long[] f = nttmb(fa, m, true, P, g);
		return f;
	}
	static long[] multiply(long a[],long b[],int mod)
	{
		long v=mod;
		v*=mod;
		long ans[]=new long[a.length+b.length-1];
		for(int i=0;i<a.length;i++)
			for(int j=0;j<b.length;j++)
			{
				ans[i+j]+=a[i]*b[j];
				if(ans[i+j]>=v)
					ans[i+j]-=v;
			}
		for(int i=0;i<ans.length;i++)
			ans[i]%=mod;
		return ans;
	}
	public static long[] convolute(long[] a, long[] b, int USE, int mod) {
		if(a.length+b.length<=200)
			return multiply(a,b,mod);
		int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2);
		long[][] fs = new long[USE][];
		for (int k = 0; k < USE; k++) {
			int P = NTTPrimes[k], g = NTTPrimitiveRoots[k];
			long[] fa = nttmb(a, m, false, P, g);
			long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
			for (int i = 0; i < m; i++) {
				fa[i] = fa[i] * fb[i] % P;
			}
			fs[k] = nttmb(fa, m, true, P, g);
		}

		int[] mods = Arrays.copyOf(NTTPrimes, USE);
		long[] gammas = garnerPrepare(mods);
		int[] buf = new int[USE];
		for (int i = 0; i < fs[0].length; i++) {
			for (int j = 0; j < USE; j++) {
				buf[j] = (int) fs[j][i];
			}
			long[] res = garnerBatch(buf, mods, gammas);
			long ret = 0;
			for (int j = res.length - 1; j >= 0; j--) {
				ret = (ret * mods[j] + res[j]) % mod;
			}
			fs[0][i] = ret;
		}
		return fs[0];
	}

	// static int[] wws = new int[270000]; // outer faster
	// Modifed Montgomery + Barrett
	private static long[] nttmb(long[] src, int n, boolean inverse, int P, int g) {
		long[] dst = Arrays.copyOf(src, n);

		int h = Integer.numberOfTrailingZeros(n);
		long K = Integer.highestOneBit(P) << 1;
		int H = Long.numberOfTrailingZeros(K) * 2;
		long M = K * K / P;

		int[] wws = new int[1 << h - 1];
		long dw = inverse ? pow(g, P - 1 - (P - 1) / n, P) : pow(g, (P - 1) / n, P);
		long w = (1L << 32) % P;
		for (int k = 0; k < 1 << h - 1; k++) {
			wws[k] = (int) w;
			w = modh(w * dw, M, H, P);
		}
		long J = invl(P, 1L << 32);
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < 1 << i; j++) {
				for (int k = 0, s = j << h - i, t = s | 1 << h - i - 1; k < 1 << h - i - 1; k++, s++, t++) {
					long u = (dst[s] - dst[t] + 2 * P) * wws[k];
					dst[s] += dst[t];
					if (dst[s] >= 2 * P) {
						dst[s] -= 2 * P;
					}
//					long Q = (u&(1L<<32)-1)*J&(1L<<32)-1;
					long Q = (u << 32) * J >>> 32;
					dst[t] = (u >>> 32) - (Q * P >>> 32) + P;
				}
			}
			if (i < h - 1) {
				for (int k = 0; k < 1 << h - i - 2; k++) {
					wws[k] = wws[k * 2];
				}
			}
		}
		for (int i = 0; i < n; i++) {
			if (dst[i] >= P) {
				dst[i] -= P;
			}
		}
		for (int i = 0; i < n; i++) {
			int rev = Integer.reverse(i) >>> -h;
			if (i < rev) {
				long d = dst[i];
				dst[i] = dst[rev];
				dst[rev] = d;
			}
		}

		if (inverse) {
			long in = invl(n, P);
			for (int i = 0; i < n; i++) {
				dst[i] = modh(dst[i] * in, M, H, P);
			}
		}

		return dst;
	}

	// Modified Shoup + Barrett
	private static long[] nttsb(long[] src, int n, boolean inverse, int P, int g) {
		long[] dst = Arrays.copyOf(src, n);

		int h = Integer.numberOfTrailingZeros(n);
		long K = Integer.highestOneBit(P) << 1;
		int H = Long.numberOfTrailingZeros(K) * 2;
		long M = K * K / P;

		long dw = inverse ? pow(g, P - 1 - (P - 1) / n, P) : pow(g, (P - 1) / n, P);
		long[] wws = new long[1 << h - 1];
		long[] ws = new long[1 << h - 1];
		long w = 1;
		for (int k = 0; k < 1 << h - 1; k++) {
			wws[k] = (w << 32) / P;
			ws[k] = w;
			w = modh(w * dw, M, H, P);
		}
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < 1 << i; j++) {
				for (int k = 0, s = j << h - i, t = s | 1 << h - i - 1; k < 1 << h - i - 1; k++, s++, t++) {
					long ndsts = dst[s] + dst[t];
					if (ndsts >= 2 * P) {
						ndsts -= 2 * P;
					}
					long T = dst[s] - dst[t] + 2 * P;
					long Q = wws[k] * T >>> 32;
					dst[s] = ndsts;
					dst[t] = ws[k] * T - Q * P & (1L << 32) - 1;
				}
			}
//			dw = dw * dw % P;
			if (i < h - 1) {
				for (int k = 0; k < 1 << h - i - 2; k++) {
					wws[k] = wws[k * 2];
					ws[k] = ws[k * 2];
				}
			}
		}
		for (int i = 0; i < n; i++) {
			if (dst[i] >= P) {
				dst[i] -= P;
			}
		}
		for (int i = 0; i < n; i++) {
			int rev = Integer.reverse(i) >>> -h;
			if (i < rev) {
				long d = dst[i];
				dst[i] = dst[rev];
				dst[rev] = d;
			}
		}

		if (inverse) {
			long in = invl(n, P);
			for (int i = 0; i < n; i++) {
				dst[i] = modh(dst[i] * in, M, H, P);
			}
		}

		return dst;
	}

	static final long mask = (1L << 31) - 1;

	public static long modh(long a, long M, int h, int mod) {
		long r = a - ((M * (a & mask) >>> 31) + M * (a >>> 31) >>> h - 31) * mod;
		return r < mod ? r : r - mod;
	}

	private static long[] garnerPrepare(int[] m) {
		int n = m.length;
		assert n == m.length;
		if (n == 0) {
			return new long[0];
		}
		long[] gamma = new long[n];
		for (int k = 1; k < n; k++) {
			long prod = 1;
			for (int i = 0; i < k; i++) {
				prod = prod * m[i] % m[k];
			}
			gamma[k] = invl(prod, m[k]);
		}
		return gamma;
	}

	private static long[] garnerBatch(int[] u, int[] m, long[] gamma) {
		int n = u.length;
		assert n == m.length;
		long[] v = new long[n];
		v[0] = u[0];
		for (int k = 1; k < n; k++) {
			long temp = v[k - 1];
			for (int j = k - 2; j >= 0; j--) {
				temp = (temp * m[j] + v[j]) % m[k];
			}
			v[k] = (u[k] - temp) * gamma[k] % m[k];
			if (v[k] < 0) {
				v[k] += m[k];
			}
		}
		return v;
	}

	private static long pow(long a, long n, long mod) {
		//		a %= mod;
		long ret = 1;
		int x = 63 - Long.numberOfLeadingZeros(n);
		for (; x >= 0; x--) {
			ret = ret * ret % mod;
			if (n << 63 - x < 0) {
				ret = ret * a % mod;
			}
		}
		return ret;
	}

	private static long invl(long a, long mod) {
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		return p < 0 ? p + mod : p;
	}
	static class Scanner {
		BufferedReader br;
		StringTokenizer tk = new StringTokenizer("");

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

		public int nextInt() throws IOException {
			if (tk.hasMoreTokens())
				return Integer.parseInt(tk.nextToken());
			tk = new StringTokenizer(br.readLine());
			return nextInt();
		}

		public long nextLong() throws IOException {
			if (tk.hasMoreTokens())
				return Long.parseLong(tk.nextToken());
			tk = new StringTokenizer(br.readLine());
			return nextLong();
		}

		public String next() throws IOException {
			if (tk.hasMoreTokens())
				return (tk.nextToken());
			tk = new StringTokenizer(br.readLine());
			return next();
		}

		public String nextLine() throws IOException {
			tk = new StringTokenizer("");
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			if (tk.hasMoreTokens())
				return Double.parseDouble(tk.nextToken());
			tk = new StringTokenizer(br.readLine());
			return nextDouble();
		}

		public char nextChar() throws IOException {
			if (tk.hasMoreTokens())
				return (tk.nextToken().charAt(0));
			tk = new StringTokenizer(br.readLine());
			return nextChar();
		}

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

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

		public int[] nextIntArrayOneBased(int n) throws IOException {
			int a[] = new int[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextLongArrayOneBased(int n) throws IOException {
			long a[] = new long[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextLong();
			return a;
		}

	}

	public static void main(String args[]) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					solve();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();

	}

	static void solve() throws IOException {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n=in.nextInt()/2;
		long b[]=new long[10];
		for(int i=in.nextInt();i>0;i--)
			b[in.nextInt()]=1;
		long mod=998244353;
		long ans[]=new long[1];
		ans[0]=1;
		while(n>0){
			if((n&1)==1){
				ans=convoluteSimply(ans,b,(int)mod,3);
				int sz=ans.length-1;
				while(sz>0 && ans[sz]==0)
					sz--;
				if(ans.length-sz > 100)
					ans=Arrays.copyOf(ans,sz+1);
			}
			n>>=1;
			b=convoluteSimply(b,b,(int)mod,3);
			int sz=b.length-1;
			while(sz>0 && b[sz]==0)
				sz--;
			if(b.length-sz > 100)
				b=Arrays.copyOf(b,sz+1);
		}
		long res=0;
		for(int i=0;i<ans.length;i++){
			res+=(ans[i]*ans[i]);
			res%=mod;
		}
		out.println(res);
		out.close();

	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int mod = 998244353;
            int n = in.nextInt();
            int k = in.nextInt();
            int[] v = new int[10];
            for (int i = 0; i < k; i++) {
                int x = in.nextInt();
                v[x] = 1;
            }
            int[] ans = {1};
            int p = n / 2;
            while (true) {
                if (p % 2 != 0) {
                    ans = multiplyMod(ans, v, mod);
                }
                p /= 2;
                if (p == 0) break;
                v = multiplyMod(v, v, mod);
            }
            int res = 0;
            for (int x : ans) {
                res = (int) ((res + (long) x * x) % mod);
            }
            out.println(res);
        }

        static int[] multiplyMod(int[] a, int[] b, int mod) {
            int need = a.length + b.length - 1;
            int n = Math.max(2, Integer.highestOneBit(need - 1) << 1);
            double[] aReal = new double[n];
            double[] aImaginary = new double[n];
            for (int i = 0; i < a.length; i++) {
                int x = (a[i] % mod + mod) % mod;
                aReal[i] = x & ((1 << 15) - 1);
                aImaginary[i] = x >> 15;
            }
            if (n == 524288) {

                int z = 1;
            }
            fft(aReal, aImaginary, false);

            double[] bReal = new double[n];
            double[] bImaginary = new double[n];
            if (a == b) {
                System.arraycopy(aReal, 0, bReal, 0, n);
                System.arraycopy(aImaginary, 0, bImaginary, 0, n);
            } else {
                for (int i = 0; i < b.length; i++) {
                    int x = (b[i] % mod + mod) % mod;
                    bReal[i] = x & ((1 << 15) - 1);
                    bImaginary[i] = x >> 15;
                }
                fft(bReal, bImaginary, false);
            }

            double[] faReal = new double[n];
            double[] faImaginary = new double[n];
            double[] fbReal = new double[n];
            double[] fbImaginary = new double[n];

            double cf = 0.25 / n;
            for (int i = 0; i < n; i++) {
                int j = (n - i) & (n - 1);

                double a1r = (aReal[i] + aReal[j]);
                double a1i = (aImaginary[i] - aImaginary[j]);
                double a2r = (aImaginary[i] + aImaginary[j]);
                double a2i = (aReal[j] - aReal[i]);

                double b1r = (bReal[i] + bReal[j]) * cf;
                double b1i = (bImaginary[i] - bImaginary[j]) * cf;
                double b2r = (bImaginary[i] + bImaginary[j]) * cf;
                double b2i = (bReal[j] - bReal[i]) * cf;

                faReal[i] = a1r * b1r - a1i * b1i - a2r * b2i - a2i * b2r;
                faImaginary[i] = a1r * b1i + a1i * b1r + a2r * b2r - a2i * b2i;

                fbReal[i] = a1r * b2r - a1i * b2i + a2r * b1r - a2i * b1i;
                fbImaginary[i] = a1r * b2i + a1i * b2r + a2r * b1i + a2i * b1r;
            }

            fft(faReal, faImaginary, true);
            fft(fbReal, fbImaginary, true);
            int[] res = new int[need];
            for (int i = 0; i < need; i++) {
                long aa = (long) (faReal[i] + 0.5);
                long bb = (long) (fbReal[i] + 0.5);
                long cc = (long) (faImaginary[i] + 0.5);
                res[i] = (int) ((aa + ((bb % mod) << 15) + ((cc % mod) << 30)) % mod);
            }
            if (need + 1 < n && Math.abs(faReal[need + 1]) > 0.5) {
                int z = 1;
            }
            return res;
        }

        static void fft(double[] a, double[] b, boolean inverse) {
            int n = a.length;
            int shift = 32 - Integer.numberOfTrailingZeros(n);
            for (int i = 1; i < n; i++) {
                int j = Integer.reverse(i << shift);
                if (i < j) {
                    double temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                    temp = b[i];
                    b[i] = b[j];
                    b[j] = temp;
                }
            }
            for (int len = 2; len <= n; len <<= 1) {
                int halfLen = len >> 1;
                double[] cs = new double[halfLen];
                double[] sn = new double[halfLen];
                for (int i = 0; i < halfLen; i++) {
                    cs[i] = Math.cos(2 * Math.PI * i / len * (inverse ? -1 : 1));
                    sn[i] = Math.sin(2 * Math.PI * i / len * (inverse ? -1 : 1));
                }
                for (int i = 0; i < n; i += len) {
                    for (int j = 0; j < halfLen; j++) {
                        double wA = cs[j];
                        double wB = sn[j];

                        double uA = a[i + j];
                        double uB = b[i + j];
                        double vA = a[i + j + halfLen] * wA - b[i + j + halfLen] * wB;
                        double vB = a[i + j + halfLen] * wB + b[i + j + halfLen] * wA;
                        a[i + j] = uA + vA;
                        b[i + j] = uB + vB;
                        a[i + j + halfLen] = uA - vA;
                        b[i + j + halfLen] = uB - vB;
                    }
                }
            }
//        if (inverse) {
//            for (int i = 0; i < n; i++) {
//                a[i] /= n;
//                b[i] /= n;
//            }
//        }
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buf = new byte[1024];
        int pos;
        int size;

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

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

        int read() {
            if (size == -1)
                throw new InputMismatchException();
            if (pos >= size) {
                pos = 0;
                try {
                    size = is.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (size <= 0)
                    return -1;
            }
            return buf[pos++] & 255;
        }

        static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

/*
 * 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 Andy Phan
 */
public class p1096g {
    static long MOD = 998244353;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        long[] base = new long[10];
        for(int i = 0; i < k; i++) base[in.nextInt()] = 1;
        long[] res = expo(base, n>>1);
        long tot = 0;
        for(long e : res) tot = (tot+(e*e)%MOD)%MOD;
        System.out.println(tot);
    }

    static long[] expo(long[] orig, long pow) {
        if(pow == 1) return orig;
        if((pow&1) != 0) return FFT.multiplyPrecise(orig, expo(orig, pow-1));
        long[] tmp = expo(orig, pow>>1);
        return FFT.multiplyPrecise(tmp, tmp);
    }

    // SET maxk appropriately!!! ~log(maxn) //%
    static class FFT {
        static final int maxk = 21, maxn = (1 << maxk) + 1;
        // Init: wR, wI, rR, rI, aR, aI   to   new double[maxn] !!!
        //#
        static double[] wR = new double[maxn],
                wI = new double[maxn],
                rR = new double[maxn],
                rI = new double[maxn],
                aR  = new double[maxn],
                aI  = new double[maxn]; //$
        static int n, k, lastk = -1, dp[] = new int[maxn];

        static void fft(boolean inv) {
            if (lastk != k) {
                lastk = k;  dp[0] = 0;
                for (int i = 1, g = -1; i < n; i++) {
                    if ((i & (i - 1)) == 0) g++;
                    dp[i] = dp[i ^ (1 << g)] ^ (1 << (k - 1 - g));
                }
                wR[1] = 1;
                wI[1] = 0;
                for (int t = 0; t < k - 1; t++) {
                    double a = Math.PI / n * (1 << (k - 1 - t));
                    double curR = Math.cos(a), curI = Math.sin(a);
                    int p2 = (1 << t), p3 = p2 * 2;
                    for (int j = p2, k = j * 2; j < p3; j++, k += 2) {
                        wR[k] = wR[j];
                        wI[k] = wI[j];
                        wR[k + 1] = wR[j] * curR - wI[j] * curI;
                        wI[k + 1] = wR[j] * curI + wI[j] * curR;
                    }
                }
            }
            for (int i = 0; i < n; i++) {
                int d = dp[i];
                if (i < d) {
                    double tmp = aR[i];
                    aR[i] = aR[d];
                    aR[d] = tmp;
                    tmp = aI[i];
                    aI[i] = aI[d];
                    aI[d] = tmp;
                }
            }
            if (inv) for (int i = 0; i < n; i++) aI[i] = -aI[i];
            for (int len = 1; len < n; len <<= 1) {
                for (int i = 0; i < n; i += len) {
                    int wit = len;
                    for (int it = 0, j = i + len; it < len; it++, i++, j++) {
                        double tmpR = aR[j] * wR[wit] - aI[j] * wI[wit];
                        double tmpI = aR[j] * wI[wit] + aI[j] * wR[wit];
                        wit++;
                        aR[j] = aR[i] - tmpR;
                        aI[j] = aI[i] - tmpI;
                        aR[i] += tmpR;
                        aI[i] += tmpI;
                    }
                }
            }
        }

        static long[] multiply(long[] a, long[] b) {
            int na = a.length, nb = b.length;
            for (k = 0, n = 1; n < na + nb - 1; n <<= 1, k++) {}
            for (int i = 0; i < n; ++i) {
                aR[i] = i < na ? a[i] : 0;
                aI[i] = i < nb ? b[i] : 0;
            }
            fft(false);
            aR[n] = aR[0];
            aI[n] = aI[0];
            double q = -1.0 / n / 4.0;
            for (int i = 0; i <= n - i; ++i) {
                double tmpR = aR[i] * aR[i] - aI[i] * aI[i];
                double tmpI = aR[i] * aI[i] * 2;
                tmpR -= aR[n - i] * aR[n - i] - aI[n - i] * aI[n - i];
                tmpI -= aR[n - i] * aI[n - i] * -2;
                aR[i] = -tmpI * q;
                aI[i] = tmpR * q;
                aR[n - i] = aR[i];
                aI[n - i] = -aI[i];
            }
            fft(true);
            long[] ans = new long[n = na + nb - 1]; // ONLY MOD IF NEEDED
            for (int i = 0; i < n; i++) ans[i] = Math.round(aR[i]) % MOD;
            return ans;
        }
        static void fft2(double[][] xr, double[][] xi, boolean inv) {
            n = xr[0].length;
            k = Integer.numberOfTrailingZeros(n);
            for (int i = 0; i < xr.length; i++) {
                for (int j = 0; j < n; j++) { aR[j] = xr[i][j];  aI[j] = xi[i][j]; }
                fft(inv);
                for (int j=0;j<n;j++){xr[i][j] = aR[j] / (inv ? n : 1);  xi[i][j] = aI[j] / (inv ? -n : 1);}
            }
            n = xr.length;
            k = Integer.numberOfTrailingZeros(n);
            for (int j = 0; j < xr[0].length; j++) {
                for (int i = 0; i < n; i++) { aR[i] = xr[i][j];  aI[i] = xi[i][j]; }
                fft(inv);
                for (int i=0;i<n;i++){xr[i][j] = aR[i] / (inv ? n : 1);  xi[i][j] = aI[i] / (inv ? -n : 1);}
            }
        }
        static long[][] multiply2(long[][] a, long[][] b) {
            int n1, n2;
            for (n1 = 1; n1 < a.length + b.length - 1; n1 <<= 1) {}
            for (n2 = 1; n2 < a[0].length + b[0].length - 1; n2 <<= 1) {}
            double[][] ar = new double[n1][n2], ai = new double[n1][n2];
            double[][] br = new double[n1][n2], bi = new double[n1][n2];
            for (int i = 0; i < a.length; i++) for(int j=0;j<a[i].length;j++) ar[i][j] = a[i][j];
            for (int i = 0; i < b.length; i++) for(int j=0;j<b[i].length;j++) br[i][j] = b[i][j];
            fft2(ar,ai,false); fft2(br,bi,false);
            for (int i = 0; i < n1; i++) {
                for(int j = 0; j < n2; j++) {
                    double r1 = ar[i][j], r2 = br[i][j];
                    double i1 = ai[i][j], i2 = bi[i][j];
                    double real = r1 * r2 - i1 * i2;
                    ai[i][j] = i1 * r2+ i2*r1;
                    ar[i][j] = real;
                }
            }
            fft2(ar,ai,true);  long[][] result = new long[n1=a.length+b.length-1][n2=a[0].length+b[0].length-1];
            for (int i = 0; i < n1; i++)
                for(int j = 0; j < n2; j++) result[i][j] = Math.round(ar[i][j]);
            return result;
        }
        //#
        static long[] multiplyPrecise(long[] a, long[] b) {
            long k = (long)(Math.sqrt(MOD));
            long[] a1 = new long[a.length], a2 = new long[a.length];
            long[] b1 = new long[b.length], b2 = new long[b.length];
            for(int i=0;i<a.length;i++) {
                a1[i] = a[i] % k;
                a2[i] = a[i] / k;
            }
            for(int i=0;i<b.length;i++) {
                b1[i] = b[i] % k;
                b2[i] = b[i] / k;
            }
            long[] r11 = multiply(a1, b1), r12 = multiply(a1, b2), r21 = multiply(a2, b1), r22 = multiply(a2, b2);
            long[] res = new long[r11.length];
            for(int i=0;i<res.length;i++)
                res[i] = (k*k*r22[i] + k*(r12[i] + r21[i]) + r11[i]) % MOD;
            return res;
        }
        //$
        //#
        static long[] multiplyOr(long[] eq1, long[] eq2) {
            int n = Math.max(eq1.length, eq2.length);
            if((n & (n-1)) != 0)
                n = Integer.highestOneBit(n)*2;
            eq1 = fftOr(eq1, n, false);
            eq2 = fftOr(eq2, n, false);
            for(int i=0;i<eq1.length;i++)
                eq1[i] *= eq2[i];
            eq1 = fftOr(eq1, n, true);
            return eq1;
        }
        //$
        // To use: FFT both, product, iFFT (n is next power of 2)
        static long[] fftOr(long[] arr, int n, boolean invert) {
            long[] ans = Arrays.copyOf(arr, n);
            for (int b = 1; b < n; b <<= 1)
                for (int i = 0; i < n; i++) {
                    if ((i & b) != 0) continue;
                    ans[i + b] += invert ? -ans[i] : ans[i];
                }
            return ans;
        }
        static long[] fftXor(long[] arr, int n, boolean invert) {
            long[] ans = Arrays.copyOf(arr, n);
            for (int b = 1; b < n; b <<= 1)
                for (int i = 0; i < n; i++) {
                    if((i & b) != 0) continue;
                    long u = ans[i], v = ans[i+b];
                    ans[i] = u + v;  ans[i + b] = u - v;
                }
            if (invert) for (int i = 0; i < n; i++) ans[i] /= n;
            return ans;
        }
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        LuckyTickets solver = new LuckyTickets();
        solver.solve(1, in, out);
        out.close();
    }

    static class LuckyTickets {
        int MOD = 998244353;
        static long mask = (1L << 31) - 1;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int k = in.nextInt();
            long[] dig = new long[11];
            for (int i = 0; i < k; i++) {
                dig[10 - in.nextInt()] = 1;
            }
            int power = N / 2;
            long[] res = new long[1];
            res[0] = 1;
            while (power > 0) {
                if (((power & 1) > 0)) {
                    res = convoluteSimply(res.clone(), dig.clone(), MOD, 3);
                }
                dig = convoluteSimply(dig.clone(), dig.clone(), MOD, 3);
                power >>= 1;
            }
            long output = 0;
            for (int i = 0; i < res.length; i++) {
                output += res[i] * res[i];
                output %= 998244353;
            }
            out.println(output);
        }

        public static long[] convoluteSimply(long[] a, long[] b, int P, int g) {
            int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2);
            long[] fa = nttmb(a, m, false, P, g);
            long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
            for (int i = 0; i < m; i++) {
                fa[i] = fa[i] * fb[i] % P;
            }
            return nttmb(fa, m, true, P, g);
        }

        private static long[] nttmb(long[] src, int n, boolean inverse, int P, int g) {
            long[] dst = Arrays.copyOf(src, n);

            int h = Integer.numberOfTrailingZeros(n);
            long K = Integer.highestOneBit(P) << 1;
            int H = Long.numberOfTrailingZeros(K) * 2;
            long M = K * K / P;

            int[] wws = new int[1 << h - 1];
            long dw = inverse ? pow(g, P - 1 - (P - 1) / n, P) : pow(g, (P - 1) / n, P);
            long w = (1L << 32) % P;
            for (int k = 0; k < 1 << h - 1; k++) {
                wws[k] = (int) w;
                w = modh(w * dw, M, H, P);
            }
            long J = invl(P, 1L << 32);
            for (int i = 0; i < h; i++) {
                for (int j = 0; j < 1 << i; j++) {
                    for (int k = 0, s = j << h - i, t = s | 1 << h - i - 1; k < 1 << h - i - 1; k++, s++, t++) {
                        long u = (dst[s] - dst[t] + 2 * P) * wws[k];
                        dst[s] += dst[t];
                        if (dst[s] >= 2 * P) dst[s] -= 2 * P;
//					long Q = (u&(1L<<32)-1)*J&(1L<<32)-1;
                        long Q = (u << 32) * J >>> 32;
                        dst[t] = (u >>> 32) - (Q * P >>> 32) + P;
                    }
                }
                if (i < h - 1) {
                    for (int k = 0; k < 1 << h - i - 2; k++) wws[k] = wws[k * 2];
                }
            }
            for (int i = 0; i < n; i++) {
                if (dst[i] >= P) dst[i] -= P;
            }
            for (int i = 0; i < n; i++) {
                int rev = Integer.reverse(i) >>> -h;
                if (i < rev) {
                    long d = dst[i];
                    dst[i] = dst[rev];
                    dst[rev] = d;
                }
            }

            if (inverse) {
                long in = invl(n, P);
                for (int i = 0; i < n; i++) dst[i] = modh(dst[i] * in, M, H, P);
            }

            return dst;
        }

        public static long modh(long a, long M, int h, int mod) {
            long r = a - ((M * (a & mask) >>> 31) + M * (a >>> 31) >>> h - 31) * mod;
            return r < mod ? r : r - mod;
        }

        private static long pow(long a, long n, long mod) {
            //		a %= mod;
            long ret = 1;
            int x = 63 - Long.numberOfLeadingZeros(n);
            for (; x >= 0; x--) {
                ret = ret * ret % mod;
                if (n << 63 - x < 0)
                    ret = ret * a % mod;
            }
            return ret;
        }

        private static long invl(long a, long mod) {
            long b = mod;
            long p = 1, q = 0;
            while (b > 0) {
                long c = a / b;
                long d;
                d = a;
                a = b;
                b = d % b;
                d = p;
                p = q;
                q = d - c * q;
            }
            return p < 0 ? p + mod : p;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}


import java.util.*;

import javax.swing.Painter;

import java.io.*;
import java.lang.reflect.Array;
import java.math.*;

public class Main {

	static int mod = 998244353;
	static int g = 3;

	static long qpow(long a, long n) {
		long x = 1;
		a %= mod;
		while(n > 0) {
			if((n & 1) == 1) x = x * a % mod;
			a = a * a % mod; n >>= 1;
		}
		return x;
	}

	static void rader(long[] y, int len) {
		for(int i = 1, j = len / 2; i < len - 1; i++) {
			if(i < j) { long tmp = y[i]; y[i] = y[j]; y[j] = tmp; }
			int k = len / 2;
			while(j >= k) { j -= k; k /= 2; }
			if(j < k) j += k;
		}
	}

	static void NTT(long[] y, int len, int on) {
		rader(y, len);
		for(int h = 2; h <= len; h <<= 1) {
			long wn = qpow(g, (mod-1)/h);
			if(on == -1) wn = qpow(wn, mod-2);
			for(int j = 0; j < len; j += h) {
				long w = 1;
				for(int k = j; k < j + h / 2; k++) {
					long u = y[k];
					long t = w * y[k + h / 2] % mod;
					y[k] = (u + t) % mod;
					y[k+h/2] = (u - t + mod) % mod;
					w = w * wn % mod;
				}
			}
		}
		if(on == -1) {
			long t = qpow(len, mod - 2);
			for(int i = 0; i < len; i++)
				y[i] = y[i] * t % mod;
		}
	}

	public static void main(String[] args) throws IOException {
		FastScanner in = new FastScanner(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		int n = in.nextInt(), m = in.nextInt();
		int len = 1, nn = n / 2;
		while(len < (9 * nn + 1)) len <<= 1;
		long[] a = new long[len];

		for(int i = 0; i < m; i++) {
			int x = in.nextInt();
			a[x] = 1;
		}

		NTT(a, len, 1);

		for(int i = 0; i < len; i++) if(a[i] != 0) {
			a[i] = qpow(a[i], nn) % mod;
		}

		NTT(a, len, -1);

		long ans = 0;
		for(int i = 0; i < len; i++)
			ans = (ans + a[i] * a[i]) % mod;

		out.println((ans + mod) % mod);

		out.close();
    }

	static class FastScanner {
		private StringTokenizer ST;
		private BufferedReader BR;
		private PrintWriter PW;

		public FastScanner(InputStreamReader stream) {
			BR = new BufferedReader(stream);
		}

		public String next() {
			while (ST == null || !ST.hasMoreTokens()) {
				try {
					ST = new StringTokenizer(BR.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return ST.nextToken();
		}

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

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

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

	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        GLuckyTickets solver = new GLuckyTickets();
        solver.solve(1, in, out);
        out.close();
    }

    static class GLuckyTickets {
        public int mod = 998244353;
        int[] d;

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int k = in.scanInt();
            d = new int[k];
            in.scanInt(d, k);
            long[] way = new long[10];
            for (int i : d) way[i]++;
            long ans = 0;
            long[] dp = null;
            n /= 2;
            while (n > 0) {
                if ((n & 1) == 1) {
                    if (dp == null) dp = Arrays.copyOf(way, way.length);
                    else {
                        long[] dp1 = Arrays.copyOf(dp, dp.length);
                        dp = FFT.convoluteSimply(dp1, way, mod, 3);
                    }
                }
                n >>= 1;
                way = FFT.convoluteSimply(way, way, mod, 3);
            }
            for (int i = 0; i < dp.length; i++) ans = (ans + dp[i] * dp[i]) % mod;
            out.println(ans);
        }

    }

    static class CodeHash {
        public static long pow(long a, long b, long m) {
            long res = 1;
            a %= m;
            while (b > 0) {
                if ((b & 1) == 1) res = (res * a) % m;
                a = (a * a) % m;
                b >>= 1;
            }
            return res;
        }

    }

    static class FFT {
        public static long[] convoluteSimply(long[] a, long[] b, int P, int g) {
            int m = Math.max(2, Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2);
            long[] fa = nttmb(a, m, false, P, g);
            long[] fb = a == b ? fa : nttmb(b, m, false, P, g);
            for (int i = 0; i < m; i++) {
                fa[i] = fa[i] * fb[i] % P;
            }
            return nttmb(fa, m, true, P, g);
        }

        private static long invl(long a, long mod) {
            long b = mod;
            long p = 1, q = 0;
            while (b > 0) {
                long c = a / b;
                long d;
                d = a;
                a = b;
                b = d % b;
                d = p;
                p = q;
                q = d - c * q;
            }
            return p < 0 ? p + mod : p;
        }

        private static long[] nttmb(long[] src, int n, boolean inverse, int P, int g) {
            long[] dst = Arrays.copyOf(src, n);

            int h = Integer.numberOfTrailingZeros(n);
            long K = Integer.highestOneBit(P) << 1;
            int H = Long.numberOfTrailingZeros(K) * 2;
            long M = K * K / P;

            int[] wws = new int[1 << h - 1];
            long dw = inverse ? CodeHash.pow(g, P - 1 - (P - 1) / n, P) : CodeHash.pow(g, (P - 1) / n, P);
            long w = (1L << 32) % P;
            for (int k = 0; k < 1 << h - 1; k++) {
                wws[k] = (int) w;
                w = modh(w * dw, M, H, P);
            }
            long J = invl(P, 1L << 32);
            for (int i = 0; i < h; i++) {
                for (int j = 0; j < 1 << i; j++) {
                    for (int k = 0, s = j << h - i, t = s | 1 << h - i - 1; k < 1 << h - i - 1; k++, s++, t++) {
                        long u = (dst[s] - dst[t] + 2 * P) * wws[k];
                        dst[s] += dst[t];
                        if (dst[s] >= 2 * P) dst[s] -= 2 * P;
//					long Q = (u&(1L<<32)-1)*J&(1L<<32)-1;
                        long Q = (u << 32) * J >>> 32;
                        dst[t] = (u >>> 32) - (Q * P >>> 32) + P;
                    }
                }
                if (i < h - 1) {
                    for (int k = 0; k < 1 << h - i - 2; k++) wws[k] = wws[k * 2];
                }
            }
            for (int i = 0; i < n; i++) {
                if (dst[i] >= P) dst[i] -= P;
            }
            for (int i = 0; i < n; i++) {
                int rev = Integer.reverse(i) >>> -h;
                if (i < rev) {
                    long d = dst[i];
                    dst[i] = dst[rev];
                    dst[rev] = d;
                }
            }

            if (inverse) {
                long in = invl(n, P);
                for (int i = 0; i < n; i++) dst[i] = modh(dst[i] * in, M, H, P);
            }

            return dst;
        }

        public static long modh(long a, long M, int h, int mod) {
            long r = a - ((M * (a & ((1L << 31) - 1)) >>> 31) + M * (a >>> 31) >>> h - 31) * mod;
            return r < mod ? r : r - mod;
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

        public void scanInt(int[] A, int size) {
            for (int i = 0; i < size; i++) A[i] = scanInt();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.AbstractQueue;
import java.util.HashMap;
import java.util.Random;
import java.util.Deque;
import java.util.function.Supplier;
import java.util.ArrayList;
import java.util.Map;
import java.io.OutputStreamWriter;
import java.io.OutputStream;
import java.util.Collection;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.function.Consumer;
import java.util.List;
import java.util.stream.Stream;
import java.io.Closeable;
import java.io.Writer;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            TaskG solver = new TaskG();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class TaskG {
        Modular mod = new Modular(998244353);

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int k = in.readInt();
            int[] allow = new int[10];
            for (int i = 0; i < k; i++) {
                allow[in.readInt()] = 1;
            }
            IntList p = new IntList();
            p.addAll(allow);

            int m = n / 2;
            IntList last = p.clone();
            NumberTheoryTransform ntt = new NumberTheoryTransform(mod, 3);
            List<IntList> lists = new ArrayList<>();
            while (m > 1) {
                if (m % 2 == 1) {
                    lists.add(last.clone());
                }
                ntt.pow2(last);
                Polynomials.normalize(last);
                m /= 2;
            }
            lists.add(last);

            IntList prod = new IntList();
            ntt.mulByPQ(lists.toArray(new IntList[0]), prod);

            int ans = 0;
            for (int i = 0; i < prod.size(); i++) {
                int plus = prod.get(i);
                ans = mod.plus(ans, mod.mul(plus, plus));
            }

            out.println(ans);
        }

    }

    static class PrimitiveRoot {
        private int[] factors;
        private Modular mod;
        private Power pow;
        int phi;
        private static PollardRho rho = new PollardRho();

        public PrimitiveRoot(Modular x) {
            phi = x.getMod() - 1;
            mod = x;
            pow = new Power(mod);
            factors = rho.findAllFactors(phi).keySet().stream().mapToInt(Integer::intValue).toArray();
        }

        public PrimitiveRoot(int x) {
            this(new Modular(x));
        }

        public int findMinPrimitiveRoot() {
            return findMinPrimitiveRoot(2);
        }

        public int findMinPrimitiveRoot(int since) {
            for (int i = since; i < mod.m; i++) {
                boolean flag = true;
                for (int f : factors) {
                    if (pow.pow(i, phi / f) == 1) {
                        flag = false;
                        break;
                    }
                }
                if (flag) {
                    return i;
                }
            }
            return -1;
        }

    }

    static class PollardRho {
        MillerRabin mr = new MillerRabin();
        Random random = new Random();

        public int findFactor(int n) {
            if (mr.mr(n, 10)) {
                return n;
            }
            while (true) {
                int f = findFactor0(random.nextInt(n), random.nextInt(n), n);
                if (f != -1) {
                    return f;
                }
            }
        }

        public Map<Integer, Integer> findAllFactors(int n) {
            Map<Integer, Integer> map = new HashMap();
            findAllFactors(map, n);
            return map;
        }

        private void findAllFactors(Map<Integer, Integer> map, int n) {
            if (n == 1) {
                return;
            }
            int f = findFactor(n);
            if (f == n) {
                Integer value = map.get(f);
                if (value == null) {
                    value = 1;
                }
                map.put(f, value * f);
                return;
            }
            findAllFactors(map, f);
            findAllFactors(map, n / f);
        }

        private int findFactor0(int x, int c, int n) {
            int xi = x;
            int xj = x;
            int j = 2;
            int i = 1;
            while (i < n) {
                i++;
                xi = (int) ((long) xi * xi + c) % n;
                int g = GCDs.gcd(n, Math.abs(xi - xj));
                if (g != 1 && g != n) {
                    return g;
                }
                if (i == j) {
                    j = j << 1;
                    xj = xi;
                }
            }
            return -1;
        }

    }

    static class MillerRabin {
        Modular modular;
        Power power;
        Random random = new Random();

        public boolean mr(int n, int s) {
            if (n == 2) {
                return true;
            }
            if (n % 2 == 0) {
                return false;
            }
            modular = new Modular(n);
            power = new Power(modular);
            for (int i = 0; i < s; i++) {
                int x = random.nextInt(n - 2) + 2;
                if (!mr0(x, n)) {
                    return false;
                }
            }
            return true;
        }

        private boolean mr0(int x, int n) {
            int exp = n - 1;
            while (true) {
                int y = power.pow(x, exp);
                if (y != 1 && y != n - 1) {
                    return false;
                }
                if (y != 1 || exp % 2 == 1) {
                    break;
                }
                exp = exp / 2;
            }
            return true;
        }

    }

    static class IntList implements Cloneable {
        private int size;
        private int cap;
        private int[] data;
        private static final int[] EMPTY = new int[0];

        public int[] getData() {
            return data;
        }

        public IntList(int cap) {
            this.cap = cap;
            if (cap == 0) {
                data = EMPTY;
            } else {
                data = new int[cap];
            }
        }

        public IntList(IntList list) {
            this.size = list.size;
            this.cap = list.cap;
            this.data = Arrays.copyOf(list.data, size);
        }

        public IntList() {
            this(0);
        }

        public void ensureSpace(int req) {
            if (req > cap) {
                while (cap < req) {
                    cap = Math.max(cap + 10, 2 * cap);
                }
                data = Arrays.copyOf(data, cap);
            }
        }

        private void checkRange(int i) {
            if (i < 0 || i >= size) {
                throw new ArrayIndexOutOfBoundsException();
            }
        }

        public int get(int i) {
            checkRange(i);
            return data[i];
        }

        public void addAll(int[] x) {
            addAll(x, 0, x.length);
        }

        public void addAll(int[] x, int offset, int len) {
            ensureSpace(size + len);
            System.arraycopy(x, offset, data, size, len);
            size += len;
        }

        public void addAll(IntList list) {
            addAll(list.data, 0, list.size);
        }

        public void expandWith(int x, int len) {
            ensureSpace(len);
            while (size < len) {
                data[size++] = x;
            }
        }

        public void retain(int n) {
            if (n < 0) {
                throw new IllegalArgumentException();
            }
            if (n >= size) {
                return;
            }
            size = n;
        }

        public int size() {
            return size;
        }

        public int[] toArray() {
            return Arrays.copyOf(data, size);
        }

        public void clear() {
            size = 0;
        }

        public String toString() {
            return Arrays.toString(toArray());
        }

        public boolean equals(Object obj) {
            if (!(obj instanceof IntList)) {
                return false;
            }
            IntList other = (IntList) obj;
            return SequenceUtils.equal(data, 0, size - 1, other.data, 0, other.size - 1);
        }

        public int hashCode() {
            int h = 1;
            for (int i = 0; i < size; i++) {
                h = h * 31 + data[i];
            }
            return h;
        }

        public IntList clone() {
            IntList ans = new IntList();
            ans.addAll(this);
            return ans;
        }

    }

    static class NumberTheoryTransform {
        private Modular modular;
        private Power power;
        private int g;
        private int[] wCache = new int[30];
        private int[] invCache = new int[30];
        public static Buffer<IntList> listBuffer = Polynomials.listBuffer;
        private Log2 log2 = new Log2();

        public NumberTheoryTransform(Modular mod) {
            this(mod, mod.getMod() == 998244353 ? 3 : new PrimitiveRoot(mod.getMod()).findMinPrimitiveRoot());
        }

        public NumberTheoryTransform(Modular mod, int g) {
            this.modular = mod;
            this.power = new Power(mod);
            this.g = g;
            for (int i = 0, until = wCache.length; i < until; i++) {
                int s = 1 << i;
                wCache[i] = power.pow(this.g, (modular.getMod() - 1) / 2 / s);
                invCache[i] = power.inverse(s);
            }
        }

        public void dotMul(int[] a, int[] b, int[] c, int m) {
            for (int i = 0, n = 1 << m; i < n; i++) {
                c[i] = modular.mul(a[i], b[i]);
            }
        }

        public void dft(int[] p, int m) {
            int n = 1 << m;

            int shift = 32 - Integer.numberOfTrailingZeros(n);
            for (int i = 1; i < n; i++) {
                int j = Integer.reverse(i << shift);
                if (i < j) {
                    int temp = p[i];
                    p[i] = p[j];
                    p[j] = temp;
                }
            }

            int w = 0;
            int t = 0;
            for (int d = 0; d < m; d++) {
                int w1 = wCache[d];
                int s = 1 << d;
                int s2 = s << 1;
                for (int i = 0; i < n; i += s2) {
                    w = 1;
                    for (int j = 0; j < s; j++) {
                        int a = i + j;
                        int b = a + s;
                        t = modular.mul(w, p[b]);
                        p[b] = modular.plus(p[a], -t);
                        p[a] = modular.plus(p[a], t);
                        w = modular.mul(w, w1);
                    }
                }
            }

        }

        public void idft(int[] p, int m) {
            dft(p, m);

            int n = 1 << m;
            int invN = invCache[m];

            p[0] = modular.mul(p[0], invN);
            p[n / 2] = modular.mul(p[n / 2], invN);
            for (int i = 1, until = n / 2; i < until; i++) {
                int a = p[n - i];
                p[n - i] = modular.mul(p[i], invN);
                p[i] = modular.mul(a, invN);
            }
        }

        public void mulByPQ(IntList[] lists, IntList ans) {
            PriorityQueue<IntList> pqs = new PriorityQueue<>(lists.length, (a, b) -> a.size() - b.size());
            for (IntList list : lists) {
                IntList clone = listBuffer.alloc();
                clone.addAll(list);
                pqs.add(clone);
            }
            while (pqs.size() > 1) {
                IntList a = pqs.remove();
                IntList b = pqs.remove();
                multiplyAndStoreAnswerIntoA(a, b);
                listBuffer.release(b);
                pqs.add(a);
            }

            IntList last = pqs.remove();
            ans.clear();
            ans.addAll(last);
            listBuffer.release(last);
            return;
        }

        public void pow2(IntList a) {
            int rankAns = (a.size() - 1) * 2;
            int proper = log2.ceilLog(rankAns + 1);
            a.expandWith(0, (1 << proper));
            dft(a.getData(), proper);
            dotMul(a.getData(), a.getData(), a.getData(), proper);
            idft(a.getData(), proper);
            Polynomials.normalize(a);
        }

        private void multiplyAndStoreAnswerIntoA(IntList a, IntList b) {
            int rankAns = a.size() - 1 + b.size() - 1;
            int proper = log2.ceilLog(rankAns + 1);
            a.expandWith(0, (1 << proper));
            b.expandWith(0, (1 << proper));
            dft(a.getData(), proper);
            dft(b.getData(), proper);
            dotMul(a.getData(), b.getData(), a.getData(), proper);
            idft(a.getData(), proper);
            Polynomials.normalize(a);
        }

    }

    static class Polynomials {
        public static Buffer<IntList> listBuffer = new Buffer<>(IntList::new, list -> list.clear());

        public static int rankOf(IntList p) {
            int[] data = p.getData();
            int r = p.size() - 1;
            while (r >= 0 && data[r] == 0) {
                r--;
            }
            return Math.max(0, r);
        }

        public static void normalize(IntList list) {
            list.retain(rankOf(list) + 1);
        }

    }

    static class SequenceUtils {
        public static boolean equal(int[] a, int al, int ar, int[] b, int bl, int br) {
            if ((ar - al) != (br - bl)) {
                return false;
            }
            for (int i = al, j = bl; i <= ar; i++, j++) {
                if (a[i] != b[j]) {
                    return false;
                }
            }
            return true;
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class Power {
        final Modular modular;

        public Power(Modular modular) {
            this.modular = modular;
        }

        public int pow(int x, int n) {
            if (n == 0) {
                return modular.valueOf(1);
            }
            long r = pow(x, n >> 1);
            r = modular.valueOf(r * r);
            if ((n & 1) == 1) {
                r = modular.valueOf(r * x);
            }
            return (int) r;
        }

        public int inverse(int x) {
            return pow(x, modular.m - 2);
        }

    }

    static class FastOutput implements AutoCloseable, Closeable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput println(int c) {
            cache.append(c).append('\n');
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class Buffer<T> {
        private Deque<T> deque;
        private Supplier<T> supplier;
        private Consumer<T> cleaner;

        public Buffer(Supplier<T> supplier) {
            this(supplier, (x) -> {
            });
        }

        public Buffer(Supplier<T> supplier, Consumer<T> cleaner) {
            this(supplier, cleaner, 0);
        }

        public Buffer(Supplier<T> supplier, Consumer<T> cleaner, int exp) {
            this.supplier = supplier;
            this.cleaner = cleaner;
            deque = new ArrayDeque<>(exp);
        }

        public T alloc() {
            return deque.isEmpty() ? supplier.get() : deque.removeFirst();
        }

        public void release(T e) {
            cleaner.accept(e);
            deque.addLast(e);
        }

    }

    static class Modular {
        int m;

        public int getMod() {
            return m;
        }

        public Modular(int m) {
            this.m = m;
        }

        public Modular(long m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public Modular(double m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public int valueOf(int x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return x;
        }

        public int valueOf(long x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return (int) x;
        }

        public int mul(int x, int y) {
            return valueOf((long) x * y);
        }

        public int plus(int x, int y) {
            return valueOf(x + y);
        }

        public String toString() {
            return "mod " + m;
        }

    }

    static class Log2 {
        public int ceilLog(int x) {
            return 32 - Integer.numberOfLeadingZeros(x - 1);
        }

    }

    static class GCDs {
        private GCDs() {
        }

        public static int gcd(int a, int b) {
            return a >= b ? gcd0(a, b) : gcd0(b, a);
        }

        private static int gcd0(int a, int b) {
            return b == 0 ? a : gcd0(b, a % b);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int mod = 998244353;
            int n = in.nextInt();
            int k = in.nextInt();
            int[] v = new int[10];
            for (int i = 0; i < k; i++) {
                int x = in.nextInt();
                v[x] = 1;
            }
            int[] ans = {1};
            int p = n / 2;
            while (true) {
                if (p % 2 != 0) {
                    ans = multiplyMod(ans, v, mod);
                }
                p /= 2;
                if (p == 0) break;
                v = multiplyMod(v, v, mod);
            }
            int res = 0;
            for (int x : ans) {
                res = (int) ((res + (long) x * x) % mod);
            }
            out.println(res);
        }

        static int[] multiplyMod(int[] a, int[] b, int mod) {
            int need = a.length + b.length - 1;
            int n = Math.max(2, Integer.highestOneBit(need - 1) << 1);

            double[] aReal = new double[n];
            double[] aImaginary = new double[n];
            for (int i = 0; i < a.length; i++) {
                int x = (a[i] % mod + mod) % mod;
                aReal[i] = x & ((1 << 15) - 1);
                aImaginary[i] = x >> 15;
            }
            fft(aReal, aImaginary, false);

            double[] bReal = new double[n];
            double[] bImaginary = new double[n];
            for (int i = 0; i < b.length; i++) {
                int x = (b[i] % mod + mod) % mod;
                bReal[i] = x & ((1 << 15) - 1);
                bImaginary[i] = x >> 15;
            }
            fft(bReal, bImaginary, false);

            double[] faReal = new double[n];
            double[] faImaginary = new double[n];
            double[] fbReal = new double[n];
            double[] fbImaginary = new double[n];

            for (int i = 0; i < n; i++) {
                int j = (n - i) & (n - 1);

                double a1r = (aReal[i] + aReal[j]) / 2;
                double a1i = (aImaginary[i] - aImaginary[j]) / 2;
                double a2r = (aImaginary[i] + aImaginary[j]) / 2;
                double a2i = (aReal[j] - aReal[i]) / 2;

                double b1r = (bReal[i] + bReal[j]) / 2;
                double b1i = (bImaginary[i] - bImaginary[j]) / 2;
                double b2r = (bImaginary[i] + bImaginary[j]) / 2;
                double b2i = (bReal[j] - bReal[i]) / 2;

                faReal[i] = a1r * b1r - a1i * b1i - a2r * b2i - a2i * b2r;
                faImaginary[i] = a1r * b1i + a1i * b1r + a2r * b2r - a2i * b2i;

                fbReal[i] = a1r * b2r - a1i * b2i + a2r * b1r - a2i * b1i;
                fbImaginary[i] = a1r * b2i + a1i * b2r + a2r * b1i + a2i * b1r;
            }

            fft(faReal, faImaginary, true);
            fft(fbReal, fbImaginary, true);
            int[] res = new int[need];
            for (int i = 0; i < need; i++) {
                long aa = (long) (faReal[i] + 0.5);
                long bb = (long) (fbReal[i] + 0.5);
                long cc = (long) (faImaginary[i] + 0.5);
                res[i] = (int) ((aa + ((bb % mod) << 15) + ((cc % mod) << 30)) % mod);
            }
            return res;
        }

        static void fft(double[] a, double[] b, boolean inverse) {
            int n = a.length;
            int shift = 32 - Integer.numberOfTrailingZeros(n);
//        int[] rev = new int[n];
//        for (int i = 1; i < n; i++) {
//            rev[i] = (rev[i >> 1] >> 1) + ((i & 1) == 0 ? 0 : n/2);
//        }
            for (int i = 1; i < n; i++) {
                int j = Integer.reverse(i << shift);
//            int j=rev[i];
                if (i < j) {
                    double temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                    temp = b[i];
                    b[i] = b[j];
                    b[j] = temp;
                }
            }
            for (int len = 2; len <= n; len <<= 1) {
                int halfLen = len >> 1;
                double[] cs = new double[halfLen];
                double[] sn = new double[halfLen];
                for (int i = 0; i < halfLen; i++) {
                    cs[i] = Math.cos(2 * Math.PI * i / len * (inverse ? -1 : 1));
                    sn[i] = Math.sin(2 * Math.PI * i / len * (inverse ? -1 : 1));
                }
                for (int i = 0; i < n; i += len) {
                    for (int j = 0; j < halfLen; j++) {
                        double wA = cs[j];
                        double wB = sn[j];
                        double uA = a[i + j];
                        double uB = b[i + j];
                        double vA = a[i + j + halfLen] * wA - b[i + j + halfLen] * wB;
                        double vB = a[i + j + halfLen] * wB + b[i + j + halfLen] * wA;
                        a[i + j] = uA + vA;
                        b[i + j] = uB + vB;
                        a[i + j + halfLen] = uA - vA;
                        b[i + j + halfLen] = uB - vB;
                    }
                }
            }
            if (inverse) {
                for (int i = 0; i < n; i++) {
                    a[i] /= n;
                    b[i] /= n;
                }
            }
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buf = new byte[1024];
        int pos;
        int size;

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

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

        int read() {
            if (size == -1)
                throw new InputMismatchException();
            if (pos >= size) {
                pos = 0;
                try {
                    size = is.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (size <= 0)
                    return -1;
            }
            return buf[pos++] & 255;
        }

        static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.util.*;

import javax.swing.Painter;

import java.io.*;
import java.lang.reflect.Array;
import java.math.*;

public class Main {

	static int mod = 998244353;
	static int g = 3;

	static long qpow(long a, long n) {
		long x = 1;
		a %= mod;
		while(n > 0) {
			if((n & 1) == 1) x = x * a % mod;
			a = a * a % mod; n >>= 1;
		}
		return x;
	}

	static void rader(long[] y, int len) {
		for(int i = 1, j = len / 2; i < len - 1; i++) {
			if(i < j) { long tmp = y[i]; y[i] = y[j]; y[j] = tmp; }
			int k = len / 2;
			while(j >= k) { j -= k; k /= 2; }
			if(j < k) j += k;
		}
	}

	static void NTT(long[] y, int len, int on) {
		rader(y, len);
		for(int h = 2; h <= len; h <<= 1) {
			long wn = qpow(g, (mod-1)/h);
			if(on == -1) wn = qpow(wn, mod-2);
			for(int j = 0; j < len; j += h) {
				long w = 1;
				for(int k = j; k < j + h / 2; k++) {
					long u = y[k];
					long t = w * y[k + h / 2] % mod;
					y[k] = (u + t) % mod;
					y[k+h/2] = (u - t + mod) % mod;
					w = w * wn % mod;
				}
			}
		}
		if(on == -1) {
			long t = qpow(len, mod - 2);
			for(int i = 0; i < len; i++)
				y[i] = y[i] * t % mod;
		}
	}

	public static void main(String[] args) throws IOException {
		FastScanner in = new FastScanner(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		int n = in.nextInt(), m = in.nextInt();
		int len = 1, nn = n / 2;
		while(len < (9 * nn + 1)) len <<= 1;
		long[] a = new long[len];
		long[] b = new long[len];

		a[0] = 1;
		for(int i = 0; i < m; i++) {
			int x = in.nextInt();
			b[x] = 1;
		}

		NTT(a, len, 1);
		NTT(b, len, 1);

		for(int i = 0; i < len; i++) {
			if(a[i] != 0 && b[i] != 0) {
				a[i] = a[i] * qpow(b[i], nn) % mod;
			} else a[i] = 0;
		}

		NTT(a, len, -1);

		long ans = 0;
		for(int i = 0; i < len; i++)
			ans = (ans + a[i] * a[i]) % mod;

		out.println((ans + mod) % mod);

		out.close();
    }

	static class FastScanner {
		private StringTokenizer ST;
		private BufferedReader BR;
		private PrintWriter PW;

		public FastScanner(InputStreamReader stream) {
			BR = new BufferedReader(stream);
		}

		public String next() {
			while (ST == null || !ST.hasMoreTokens()) {
				try {
					ST = new StringTokenizer(BR.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return ST.nextToken();
		}

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

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

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

	}
}