import java.lang.*;
import java.util.*;

public class solution{
    public static void main (String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        long[] arrb = new long[n];
        long[] arrg = new long[m];
        long ans = 0;
        long sumg = 0;
        for(int i = 0; i < n; i++){
            arrb[i] = scan.nextInt();
        }
        for(int i = 0; i < m; i++){
            arrg[i] = scan.nextInt();
            sumg = sumg + arrg[i];
        }
        Arrays.sort(arrb);
        Arrays.sort(arrg);
        if(arrb[n-1] > arrg[0]){
            System.out.println("-1");
            return;
        }
        if(arrb[n-1] == arrg[0]){
            ans = sumg;
        }else{
            ans = sumg + arrb[n-1] - arrb[n-2];
        }
        for(int i = n-2; i > -1; i--){
            ans = ans + arrb[i]*m;
        }
        System.out.println(ans);
    }
}


import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class A1158 {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		PrintStream out = System.out;

		int n = in.nextInt(), m = in.nextInt();

		long[] mins = new long[n];
		for (int i = 0; i < n; i++) {
			mins[i] = in.nextLong();
		}
		Arrays.sort(mins);

		boolean u = false;
		boolean invalid = false;

		long[] maxes = new long[m];
		for (int i = 0; i < m; i++) {
			maxes[i] = in.nextLong();

			if (maxes[i] == mins[n - 1]) {
				u = true;
			} else if (maxes[i] < mins[n - 1]) {
				invalid = true;
			}
		}

		long ret = Arrays.stream(mins).sum() * m + Arrays.stream(maxes).sum()
				- (u ? mins[n - 1] * m : mins[n - 1] * (m - 1) + mins[n - 2]);

		out.println(invalid ? -1 : ret);

	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.IntStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.OptionalInt;
import java.io.InputStream;

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

    static class AThePartyAndSweets {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.i();
            int m = in.i();
            int[] b = in.ia(n);
            int[] g = in.ia(m);
            int maxB = Arrays.stream(b).max().getAsInt();
            int minG = Arrays.stream(g).min().getAsInt();
            if (maxB > minG) {
                out.printLine(-1);
            } else {
                int sumB = ArrayUtil.sum(b);
                int sumG = ArrayUtil.sum(g);
                long ans = (long) sumB * (long) m + (long) sumG;
                if (maxB == minG) {
                    out.printLine(ans - (long) maxB * (long) m);
                } else {
                    RadixSort.radixSort(b);
                    int nextMax = b[n - 2];
                    out.printLine(ans - (long) maxB * (long) (m - 1) - (long) nextMax);
                }
            }
        }

    }

    static class InputReader {
        private InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

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

        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++];
        }

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

        public int i() {
            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();
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class ArrayUtil {
        public static int sum(int[] a) {
            return Arrays.stream(a).sum();
        }

    }

    static class RadixSort {
        public static int[] radixSort(int[] f) {
            return radixSort(f, f.length);
        }

        public static int[] radixSort(int[] f, int n) {
            // credits uwi
            int[] to = new int[n];
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] & 0xffff)]++] = f[i];
                int[] d = f;
                f = to;
                to = d;
            }
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] >>> 16 & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] >>> 16 & 0xffff)]++] = f[i];
                int[] d = f;
                f = to;
                to = d;
            }
            return f;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.stream.LongStream;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class AThePartyAndSweets {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.i();
            int m = in.i();
            long[] b = in.la(n);
            long[] g = in.la(m);
            long maxB = ArrayUtil.max(b);
            long minG = ArrayUtil.min(g);
            if (maxB > minG) {
                out.printLine(-1);
            } else {
                long sumB = ArrayUtil.sum(b);
                long sumG = ArrayUtil.sum(g);
                long ans = sumB * (long) m + sumG;
                if (maxB == minG) {
                    out.printLine(ans - maxB * (long) m);
                } else {
                    RadixSort.radixSort(b);
                    long nextMax = b[n - 2];
                    out.printLine(ans - maxB * (long) (m - 1) - nextMax);
                }
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class ArrayUtil {
        public static long min(long[] a) {
            return Arrays.stream(a).reduce(Cons.INF, Long::min);
        }

        public static long max(long[] a) {
            return Arrays.stream(a).reduce(0, Long::max);
        }

        public static long sum(long[] a) {
            return Arrays.stream(a).sum();
        }

    }

    static class InputReader {
        private InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

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

        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++];
        }

        public long[] la(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) a[i] = l();
            return a;
        }

        public int i() {
            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();
            }
        }

        public long l() {
            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();
            }
        }

    }

    static class Cons {
        public static final long INF = (long) 1e18 + 100;

    }

    static class RadixSort {
        public static long[] radixSort(long[] f) {
            return radixSort(f, f.length);
        }

        public static long[] radixSort(long[] f, int n) {
            long[] to = new long[n];
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] & 0xffff)]++] = f[i];
                long[] d = f;
                f = to;
                to = d;
            }
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] >>> 16 & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] >>> 16 & 0xffff)]++] = f[i];
                long[] d = f;
                f = to;
                to = d;
            }
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] >>> 32 & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] >>> 32 & 0xffff)]++] = f[i];
                long[] d = f;
                f = to;
                to = d;
            }
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] >>> 48 & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] >>> 48 & 0xffff)]++] = f[i];
                long[] d = f;
                f = to;
                to = d;
            }
            return f;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class AThePartyAndSweets {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.i();
            int m = in.i();
            int[] b = in.ia(n);
            int[] g = in.ia(m);
            int maxB = ArrayUtil.max(b);
            int minG = ArrayUtil.min(g);
            if (maxB > minG) {
                out.printLine(-1);
            } else {
                int sumB = ArrayUtil.sum(b);
                int sumG = ArrayUtil.sum(g);
                long ans = (long) sumB * (long) m + (long) sumG;
                if (maxB == minG) {
                    out.printLine(ans - (long) maxB * (long) m);
                } else {
                    RadixSort.radixSort(b);
                    int nextMax = b[n - 2];
                    out.printLine(ans - (long) maxB * (long) (m - 1) - (long) nextMax);
                }
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class ArrayUtil {
        public static int min(int[] a) {
            return Arrays.stream(a).reduce(Cons.inf, Integer::min);
        }

        public static int max(int[] a) {
            return Arrays.stream(a).reduce(0, Integer::max);
        }

        public static int sum(int[] a) {
            return Arrays.stream(a).sum();
        }

    }

    static class InputReader {
        private InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

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

        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++];
        }

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

        public int i() {
            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();
            }
        }

    }

    static class Cons {
        public static final int inf = (int) 1e9 + 100;

    }

    static class RadixSort {
        public static int[] radixSort(int[] f) {
            return radixSort(f, f.length);
        }

        public static int[] radixSort(int[] f, int n) {
            // credits uwi
            int[] to = new int[n];
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] & 0xffff)]++] = f[i];
                int[] d = f;
                f = to;
                to = d;
            }
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] >>> 16 & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] >>> 16 & 0xffff)]++] = f[i];
                int[] d = f;
                f = to;
                to = d;
            }
            return f;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class AThePartyAndSweets {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.i();
            int m = in.i();
            int[] b = in.ia(n);
            int[] g = in.ia(m);
            int maxB = ArrayUtil.max(b);
            int minG = ArrayUtil.min(g);
            if (maxB > minG) {
                out.printLine(-1);
            } else {
                int sumB = ArrayUtil.sum(b);
                int sumG = ArrayUtil.sum(g);
                long ans = (long) sumB * (long) m + sumG;
                if (maxB == minG) {
                    out.printLine(ans - (long) maxB * (long) m);
                } else {
                    RadixSort.radixSort(b);
                    int nextMax = b[n - 2];
                    out.printLine(ans - maxB * (long) (m - 1) - nextMax);
                }
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class ArrayUtil {
        public static int min(int[] a) {
            return Arrays.stream(a).reduce(Cons.inf, Integer::min);
        }

        public static int max(int[] a) {
            return Arrays.stream(a).reduce(0, Integer::max);
        }

        public static int sum(int[] a) {
            return Arrays.stream(a).sum();
        }

    }

    static class InputReader {
        private InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

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

        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++];
        }

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

        public int i() {
            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();
            }
        }

    }

    static class Cons {
        public static final int inf = (int) 1e9 + 100;

    }

    static class RadixSort {
        public static int[] radixSort(int[] f) {
            return radixSort(f, f.length);
        }

        public static int[] radixSort(int[] f, int n) {
            // credits uwi
            int[] to = new int[n];
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] & 0xffff)]++] = f[i];
                int[] d = f;
                f = to;
                to = d;
            }
            {
                int[] b = new int[65537];
                for (int i = 0; i < n; i++) b[1 + (int) (f[i] >>> 16 & 0xffff)]++;
                for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                for (int i = 0; i < n; i++) to[b[(int) (f[i] >>> 16 & 0xffff)]++] = f[i];
                int[] d = f;
                f = to;
                to = d;
            }
            return f;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

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

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            int[] b = new int[n], g = new int[m];
            readArray(b, in);
            readArray(g, in);
            Arrays.sort(b);
            Arrays.sort(g);
            long res = 0;
            int idx = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                int can = m - 1;
                while (idx >= 0 && can > 0 && g[idx] >= b[i]) {
                    res += g[idx];
                    can--;
                    idx--;
                }
                if (idx >= 0 && g[idx] == b[i]) {
                    res += g[idx];
                    idx--;
                    can--;
                }
                res += (long) (can + 1) * b[i];
            }
            if (idx >= 0 || g[0] < b[n - 1]) {
                res = -1;
            }
            out.println(res);
        }

        void readArray(int[] arr, Scanner in) {
            for (int i = 0; i < arr.length; i++) {
                arr[i] = in.nextInt();
            }
        }

    }
}


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

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

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            int[] b = new int[n], g = new int[m];
            readArray(b, in);
            readArray(g, in);
            try {
                Arrays.sort(b);
                Arrays.sort(g);
            } catch (Exception e) {
            }
            long res = 0;
            int idx = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                int can = m - 1;
                while (idx >= 0 && can > 0 && g[idx] >= b[i]) {
                    res += g[idx];
                    can--;
                    idx--;
                }
                if (idx >= 0 && g[idx] == b[i]) {
                    res += g[idx];
                    idx--;
                    can--;
                }
                res += (long) (can + 1) * b[i];
            }
            if (idx >= 0 || g[0] < b[n - 1]) {
                res = -1;
            }
            out.println(res);
        }

        void readArray(int[] arr, Scanner in) {
            for (int i = 0; i < arr.length; i++) {
                arr[i] = in.nextInt();
            }
        }

    }

    static class Arrays {
        public static void sort(int[] a) throws Exception {
            if (a == null) {
                return;
            }
            Integer[] A = new Integer[a.length];
            for (int i = 0; i < a.length; i++) {
                A[i] = a[i];
            }
            sort(A);
            for (int i = 0; i < a.length; i++) {
                a[i] = A[i];
            }
        }

        public static void sort(Object[] A) throws Exception {
            if (A == null) {
                return;
            }
            sort(A, 0, A.length);
        }

        public static void sort(Object[] A, int fromIndex, int toIndex) throws Exception {
            if (A == null) {
                return;
            }
            if (fromIndex > toIndex) {
                throw new IllegalArgumentException("fromIndex > toIndex");
            }
            if (fromIndex < 0) {
                throw new ArrayIndexOutOfBoundsException("fromIndex < 0");
            }
            if (toIndex > A.length) {
                throw new ArrayIndexOutOfBoundsException("toIndex > A.length");
            }
            Object[] B = new Object[A.length];
            sort(A, fromIndex, toIndex, B);
        }

        private static void sort(Object[] A, int fromIndex, int toIndex, Object[] B) {
            if (toIndex == fromIndex + 1) {
                return;
            }
            int midIndex = fromIndex + (toIndex - fromIndex) / 2;
            sort(A, fromIndex, midIndex, B);
            sort(A, midIndex, toIndex, B);
            merge(A, fromIndex, midIndex, toIndex, B);
            System.arraycopy(B, fromIndex, A, fromIndex, toIndex - fromIndex);
        }

        private static void merge(Object[] A, int fromIndex, int midIndex, int toIndex, Object[] B) {
            for (int i = fromIndex, j = midIndex, k = fromIndex; i < midIndex || j < toIndex; ) {
                if (i < midIndex && (j == toIndex || ((Comparable) A[i]).compareTo((Comparable) A[j]) < 0)) {
                    B[k++] = A[i++];
                } else {
                    B[k++] = A[j++];
                }
            }
        }

    }
}


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

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

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) throws Exception {
            int n = in.nextInt(), m = in.nextInt();
            int[] b = new int[n], g = new int[m];
            readArray(b, in);
            readArray(g, in);
            Arrays.sort(b);
            Arrays.sort(g);
            long res = 0;
            int idx = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                int can = m - 1;
                while (idx >= 0 && can > 0 && g[idx] >= b[i]) {
                    res += g[idx];
                    can--;
                    idx--;
                }
                if (idx >= 0 && g[idx] == b[i]) {
                    res += g[idx];
                    idx--;
                    can--;
                }
                res += (long) (can + 1) * b[i];
            }
            if (idx >= 0 || g[0] < b[n - 1]) {
                res = -1;
            }
            out.println(res);
        }

        void readArray(int[] arr, Scanner in) {
            for (int i = 0; i < arr.length; i++) {
                arr[i] = in.nextInt();
            }
        }

    }

    static class Arrays {
        public static void sort(int[] a) throws Exception {
            if (a == null) {
                return;
            }
            Integer[] A = new Integer[a.length];
            for (int i = 0; i < a.length; i++) {
                A[i] = a[i];
            }
            sort(A);
            for (int i = 0; i < a.length; i++) {
                a[i] = A[i];
            }
        }

        public static void sort(Object[] A) throws Exception {
            if (A == null) {
                return;
            }
            sort(A, 0, A.length);
        }

        public static void sort(Object[] A, int fromIndex, int toIndex) throws Exception {
            if (A == null) {
                return;
            }
            if (fromIndex > toIndex) {
                throw new IllegalArgumentException("fromIndex > toIndex");
            }
            if (fromIndex < 0) {
                throw new ArrayIndexOutOfBoundsException("fromIndex < 0");
            }
            if (toIndex > A.length) {
                throw new ArrayIndexOutOfBoundsException("toIndex > A.length");
            }
            Object[] B = new Object[A.length];
            sort(A, fromIndex, toIndex, B);
        }

        private static void sort(Object[] A, int fromIndex, int toIndex, Object[] B) {
            if (toIndex == fromIndex + 1) {
                return;
            }
            int midIndex = fromIndex + (toIndex - fromIndex) / 2;
            sort(A, fromIndex, midIndex, B);
            sort(A, midIndex, toIndex, B);
            merge(A, fromIndex, midIndex, toIndex, B);
            System.arraycopy(B, fromIndex, A, fromIndex, toIndex - fromIndex);
        }

        private static void merge(Object[] A, int fromIndex, int midIndex, int toIndex, Object[] B) {
            for (int i = fromIndex, j = midIndex, k = fromIndex; i < midIndex || j < toIndex; ) {
                if (i < midIndex && (j == toIndex || ((Comparable) A[i]).compareTo((Comparable) A[j]) < 0)) {
                    B[k++] = A[i++];
                } else {
                    B[k++] = A[j++];
                }
            }
        }

    }
}


import java.util.*;
import java.io.*;

public class main{
    static Read input  = new Read();

    public static void main(String args[]){
        int n = input.nextInt(), m = input.nextInt();
        long mn[] = new long[n], mx[] = new long[m], ans=0;

        for (int i=0;i<n;i++) mn[i] = input.nextLong();
        for (int i=0;i<m;i++) mx[i] = input.nextLong();

        Arrays.sort(mn);
        Arrays.sort(mx);

        if (mn[n-1]>mx[0]){
            System.out.print(-1);
            return;
        }

        int ind = 0;
        while (ind<m && mx[ind]==mn[n-1]) ind++;
        for (int i=0;i<m;i++) ans+=mx[i];

        if (ind==0){
            ans+=mn[n-1];
            ans+=mn[n-2]*(m-1);
        } else
            ans+=mn[n-2]*m;

        for (int i=0;i<n-2;i++)
            ans+=mn[i]*m;

        System.out.println(ans);

    }

    static class Read{
        BufferedReader br;
        StringTokenizer st;
        public Read(){br = new BufferedReader(new InputStreamReader(System.in));}
        String next(){
            while (st==null || !st.hasMoreElements()){
                try { st = new StringTokenizer(br.readLine()); }
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        int nextInt(){return Integer.parseInt(next());}
        double nextDouble(){return Double.parseDouble(next());}
        long nextLong(){return Long.parseLong(next());}
        String line(){
            String ans="";
            try {ans = br.readLine(); }
            catch(IOException e) {e.printStackTrace(); }
            return ans;
        }
    }

}


import java.util.*;
import java.io.*;

public class main{
    static Read input  = new Read();

    public static void main(String args[]){
        int n = input.nextInt(), m = input.nextInt();
        int mn[] = new int[n], mx[] = new int[m], ans=0;

        for (int i=0;i<n;i++) mn[i] = input.nextInt();
        for (int i=0;i<m;i++) mx[i] = input.nextInt();

        Arrays.sort(mn);
        Arrays.sort(mx);

        if (mn[n-1]>mx[0]){
            System.out.print(-1);
            return;
        }

        int ind = 0;
        while (ind<m && mx[ind]==mn[n-1]) ind++;
        for (int i=0;i<m;i++) ans+=mx[i];

        if (ind==0){
            ans+=mn[n-1];
            ans+=mn[n-2]*(m-1);
        } else
            ans+=mn[n-2]*m;

        for (int i=0;i<n-2;i++)
            ans+=mn[i]*m;

        System.out.println(ans);

    }

    static class Read{
        BufferedReader br;
        StringTokenizer st;
        public Read(){br = new BufferedReader(new InputStreamReader(System.in));}
        String next(){
            while (st==null || !st.hasMoreElements()){
                try { st = new StringTokenizer(br.readLine()); }
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        int nextInt(){return Integer.parseInt(next());}
        double nextDouble(){return Double.parseDouble(next());}
        long nextLong(){return Long.parseLong(next());}
        String line(){
            String ans="";
            try {ans = br.readLine(); }
            catch(IOException e) {e.printStackTrace(); }
            return ans;
        }
    }

}


import java.lang.*;
import java.math.*;
import java.util.*;
import java.io.*;
public class Main {
    void solve() {
        int n=ni(),m=ni();
        int b[]=new int[n+1];
        int g[]=new int[m+1];
        int mx=0;
        for(int i=1;i<=n;i++) {
            b[i]=ni();
            mx=Math.max(mx,b[i]);
        }
        for(int i=1;i<=m;i++)g[i]=ni();
        for(int i=1;i<=m;i++){
            if(g[i]<mx){
                pw.println("-1");
                return;
            }
        }
        Arrays.sort(b,1,n+1);
        int mn=Integer.MAX_VALUE;
        for(int i=1;i<=m;i++)mn=Math.min(mn,g[i]);
        if(n==1){

            if(mn!=mx){
                pw.println("-1");
            }else {
                long ans=0;
                for(int i=1;i<=m;i++) ans+=g[i];
                pw.println(ans);
            }
            return;
        }
        if(m==1){
            if(mn!=mx){
                pw.println("-1");

            }else {
                long ans=0;
                for(int i=1;i<=n;i++) ans+=b[i];
                pw.println(ans);
            }
            return;

        }
        long pref[]=new long[n+1];
        for(int i=1;i<=n;i++) pref[i]=pref[i-1]+b[i];
        long S=0;
        for(int i=1;i<=m;i++) S+=g[i];
        long ans=0;
        if(mn==mx){
            ans=S+pref[n-1]*m;
        }else {
            ans=S+b[n]+(m-1)*1L*b[n-1];
            for(int i=1;i<=n-2;i++) ans+=b[i]*m;
        }
        pw.println(ans);

    }

    long M =(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";

    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms");

    }

    public static void main(String[] args) throws Exception {
        new Main().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 (INPUT.length() > 0) System.out.println(Arrays.deepToString(o));
    }

}


import java.lang.*;
import java.math.*;
import java.util.*;
import java.io.*;
public class Main {
    void solve() {
        int n=ni(),m=ni();
        int b[]=new int[n+1];
        int g[]=new int[m+1];
        int mx=0;
        for(int i=1;i<=n;i++) {
            b[i]=ni();
            mx=Math.max(mx,b[i]);
        }
        for(int i=1;i<=m;i++)g[i]=ni();
        for(int i=1;i<=m;i++){
            if(g[i]<mx){
                pw.println("-1");
                return;
            }
        }
        Arrays.sort(b,1,n+1);
        int mn=Integer.MAX_VALUE;
        for(int i=1;i<=m;i++)mn=Math.min(mn,g[i]);
        if(n==1){

            if(mn!=mx){
                pw.println("-1");
            }else {
                long ans=0;
                for(int i=1;i<=m;i++) ans+=g[i];
                pw.println(ans);
            }
            return;
        }
        if(m==1){
            if(mn!=mx){
                pw.println("-1");

            }else {
                long ans=0;
                for(int i=1;i<=n;i++) ans+=b[i];
                pw.println(ans);
            }
            return;

        }
        long pref[]=new long[n+1];
        for(int i=1;i<=n;i++) pref[i]=pref[i-1]+b[i];
        long S=0;
        for(int i=1;i<=m;i++) S+=g[i];
        long ans=0;
        if(mn==mx){
            ans=S+pref[n-1]*m;
        }else {
            ans=S+b[n]+(m-1)*1L*b[n-1];
            for(int i=1;i<=n-2;i++) ans+=b[i]*1L*m;
        }
        pw.println(ans);

    }

    long M =(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";

    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms");

    }

    public static void main(String[] args) throws Exception {
        new Main().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 (INPUT.length() > 0) System.out.println(Arrays.deepToString(o));
    }

}


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	LL n, m; cin >> n >> m;

	vector<LL> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<LL> b(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	sort(a.begin(), a.end());

	sort(b.begin(), b.end());

	LL ans = 0;

	LL mxman = *max_element(a.begin(), a.end());
	LL miwoman = *min_element(b.begin(), b.end());

	if (mxman > miwoman) {
		cout << "-1" << endl;
		return 0;
	}

	ans = (accumulate(a.begin(), a.begin(), 0))*m;

	for (int i = 1; i < m; i++) {
		ans += (b[i] - mxman);
	}

	if (mxman == miwoman) {
		ans += (miwoman - a[1]);
	}

	cout << ans << endl;

	return 0;
}

//A. The Party and Sweets


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	LL n, m; cin >> n >> m;

	vector<LL> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<LL> b(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	sort(a.begin(), a.end());

	sort(b.begin(), b.end());

	LL ans = 0;

	LL mxman = *max_element(a.begin(), a.end());
	LL miwoman = *min_element(b.begin(), b.end());

	if (mxman > miwoman) {
		cout << "-1" << endl;
		return 0;
	}

	ans = (accumulate(a.begin(), a.begin(), 0))*m;

	for (int i = 1; i < m; i++) {
		ans += (b[i] - mxman);
	}

	if (mxman == miwoman) {
		ans += (miwoman - a[1]);
	}

	return 0;
}

//A. The Party and Sweets


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	LL n, m; cin >> n >> m;

	vector<LL> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<LL> b(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	sort(a.begin(), a.end());

	sort(b.begin(), b.end());

	LL ans = 0;

	LL mxman = *max_element(a.begin(), a.end());
	LL miwoman = *min_element(b.begin(), b.end());

	if (mxman > miwoman) {
		cout << "-1" << endl;
		return 0;
	}

	ans = (accumulate(a.begin(), a.end(), (LL)0))*m;

	for (int i = 1; i < m; i++) {
		ans += (b[i] - mxman);
	}

	if (mxman != miwoman) {
		ans += (miwoman - a[n-2]);
	}

	cout << ans << endl;

	return 0;
}

//A. The Party and Sweets


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	LL n, m; cin >> n >> m;

	vector<LL> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<LL> b(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	sort(a.begin(), a.end());

	sort(b.begin(), b.end());

	LL ans = 0;

	LL mxman = *max_element(a.begin(), a.end());
	LL miwoman = *min_element(b.begin(), b.end());

	if (mxman > miwoman) {
		cout << "-1" << endl;
		return 0;
	}

	ans = (accumulate(a.begin(), a.end(), 0))*m;

	for (int i = 1; i < m; i++) {
		ans += (b[i] - mxman);
	}

	if (mxman != miwoman) {
		ans += (miwoman - a[n-2]);
	}

	cout << ans << endl;

	return 0;
}

//A. The Party and Sweets


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	LL n, m; cin >> n >> m;

	vector<LL> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<LL> b(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	sort(a.begin(), a.end());

	sort(b.begin(), b.end());

	LL ans = 0;

	LL mxman = *max_element(a.begin(), a.end());
	LL miwoman = *min_element(b.begin(), b.end());

	if (mxman > miwoman) {
		cout << "-1" << endl;
		return 0;
	}

	ans = (accumulate(a.begin(), a.begin(), 0))*m;

	for (int i = 1; i < m; i++) {
		ans += (b[i] - mxman);
	}

	if (mxman == miwoman) {
		ans += (miwoman - a[n-2]);
	}

	cout << ans << endl;

	return 0;
}

//A. The Party and Sweets


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

LL a[100100], b[100100];

int main() {

	LL n, m; cin >> n >> m;

	vector<LL> a(n);

	LL ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		ans += a[i] * m;
	}

	sort(a.begin(), a.end());

	vector<LL> b(m);

	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	sort(b.begin(), b.end());

	if (a[n - 1] > b[0]) {
		cout << "-1" << endl;
		return 0;
	}

	for (int i = 1; i < m; i++) {
		ans += b[i] - a[n - 1];
	}

	if (b[0] != a[n - 1]) {
		ans += b[0]-a[n-2];
	}

	cout << ans << endl;

	return 0;
}

//A. The Party and Sweets


#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef pair<int,int> pii;
typedef long long int ll;
typedef tree<pii,null_type,less<pii>,rb_tree_tag, \
tree_order_statistics_node_update> ordered_set;

#define int ll
#define long int
#define pb push_back
#define all int i=0; i<n; i++
#define INF LLONG_MAX

#define Nirvana ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define mod 1000000007

long expo(long base, long exp)
{
    long t = 1L;
    while (exp > 0)
    {
        if (exp % 2 != 0)  t = (t * base) ;
        base = (base * base) ;
        exp /= 2;
    }
    return t;
}
#define pow expo
int abso(int k){
	if(k < 0)return -1 * k;
	else return k;
}
#define pii pair<int, int>

int32_t main(){
	Nirvana;

	int n,m;
	cin>>n>>m;

	int a[n];
	int b[m];

	for(int i=0; i<n; i++)cin>>a[i];
	for(int i=0; i<m; i++)cin>>b[i];

	sort(a, a+n);
	sort(b, b+m);

	int ans=0, flag=1;

	if(a[n-1] > b[0]){
		flag=0;
		cout<<-1<<endl;
		return 0;
	}
	int j=m-1;
	int done = 0;
	int cur=0;
	for(int i=n-1; i>=0; i--){
		cur=0;

		while(true){
			if(j==0 && done==0 && b[j]>a[i])break;
			if(j<0)break;
			else{
				ans+=b[j];
				cur++;
				j--;
			}
		}
		if(j!=m-1)done=1;
		ans+=(m-cur)*a[i];
		cout<<ans<<" "<<j<<endl;
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef pair<int,int> pii;
typedef long long int ll;
typedef tree<pii,null_type,less<pii>,rb_tree_tag, \
tree_order_statistics_node_update> ordered_set;

#define int ll
#define long int
#define pb push_back
#define all int i=0; i<n; i++
#define INF LLONG_MAX

#define Nirvana ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define mod 1000000007

long expo(long base, long exp)
{
    long t = 1L;
    while (exp > 0)
    {
        if (exp % 2 != 0)  t = (t * base) ;
        base = (base * base) ;
        exp /= 2;
    }
    return t;
}
#define pow expo
int abso(int k){
	if(k < 0)return -1 * k;
	else return k;
}
#define pii pair<int, int>

int32_t main(){
	Nirvana;

	int n,m;
	cin>>n>>m;

	int a[n];
	int b[m];

	for(int i=0; i<n; i++)cin>>a[i];
	for(int i=0; i<m; i++)cin>>b[i];

	sort(a, a+n);
	sort(b, b+m);

	int ans=0, flag=1;

	if(a[n-1] > b[0]){
		flag=0;
		cout<<-1<<endl;
		return 0;
	}
	int j=m-1;
	int done = 0;
	int cur=0;
	for(int i=n-1; i>=0; i--){
		cur=0;

		while(true){
			if(j==0 && done==0 && b[j]>a[i])break;
			if(j<0)break;
			else{
				ans+=b[j];
				cur++;
				j--;
			}
		}
		if(j!=m-1)done=1;
		ans+=(m-cur)*a[i];
		//cout<<ans<<" "<<j<<endl;
	}
	cout<<ans<<endl;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n , m;
    cin >> n >> m;
    ll b[n] , g[m];
    for( int i = 0 ; i < n ; i++ )
        cin >> b[i];
    for( int i = 0 ; i < m ; i++ )
        cin >> g[i];
    ll mx1 = -1 , mx2 = -1 , mn = INT_MAX , sumb = 0 , sumg = 0 , pos = 0;
    for( int i = 0 ; i < n ; i++ )
    {
        sumb += b[i];
        if( b[i] > mx1 )
        {
            mx1 = b[i];
            pos = i;
        }
    }
    for( int i = 0 ; i < n ; i++ )
    {
        if( b[i] > mx2 )
        {
            if( b[i] == mx1 && pos != i )
                mx2 = b[i];
            else
                mx2 = b[i];
        }
    }
    for( int i = 0 ; i < m ; i++ )
    {
        sumg += g[i];
        if( g[i] < mn )
            mn = g[i];
    }
    if( mn < mx1 )
        cout << -1 << endl;
    else if( mn == mx1 )
        cout << sumb * m + sumg - mx1 * m << endl;
    else
        cout << sumb * m + sumg - ( mx1 * ( m - 1 ) ) - mx2 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n , m;
    cin >> n >> m;
    ll b[n] , g[m];
    for( int i = 0 ; i < n ; i++ )
        cin >> b[i];
    for( int i = 0 ; i < m ; i++ )
        cin >> g[i];
    ll mx1 = -1 , mx2 = -1 , mn = INT_MAX , sumb = 0 , sumg = 0 , pos = 0;
    for( int i = 0 ; i < n ; i++ )
    {
        sumb += b[i];
        if( b[i] > mx1 )
        {
            mx1 = b[i];
            pos = i;
        }
    }
    for( int i = 0 ; i < n ; i++ )
    {
        if( b[i] > mx2 )
        {
            if( b[i] == mx1 && pos != i )
                mx2 = b[i];
            else if( b[i] != mx1 )
                mx2 = b[i];
        }
    }
    for( int i = 0 ; i < m ; i++ )
    {
        sumg += g[i];
        if( g[i] < mn )
            mn = g[i];
    }
    //cout << mx1 << " " << mx2 << endl;
    if( mn < mx1 )
        cout << -1 << endl;
    else if( mn == mx1 )
        cout << sumb * m + sumg - mx1 * m << endl;
    else
        cout << sumb * m + sumg - ( mx1 * ( m - 1 ) ) - mx2 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n , m;
    cin >> n >> m;
    ll b[n] , g[m];
    for( int i = 0 ; i < n ; i++ )
        cin >> b[i];
    for( int i = 0 ; i < m ; i++ )
        cin >> g[i];
    ll mx1 = -1 , mx2 = -1 , mn = INT_MAX , sumb = 0 , sumg = 0;
    for( int i = 0 ; i < n ; i++ )
    {
        sumb += b[i];
        if( b[i] > mx1 )
            mx1 = b[i];
    }
    for( int i = 0 ; i < n ; i++ )
    {
        if( b[i] > mx2 && b[i] != mx1 )
            mx2 = b[i];
    }
    for( int i = 0 ; i < m ; i++ )
    {
        sumg += g[i];
        if( g[i] < mn )
            mn = g[i];
    }
    if( mn < mx1 )
        cout << -1 << endl;
    else if( mn == mx1 )
        cout << sumb * m + sumg - mx1 * m << endl;
    else
        cout << sumb * m + sumg - mx1 * ( m - 1 ) - mx2 << endl;
    return 0;
}


# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <chrono>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <cctype>
# include <unistd.h>
# include <unordered_map>
# include <unordered_set>
//#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < (n); i++)
#define forx(i,x,n) for (int i = x; i < (n); i++)
#define form(i, n) for (int i = n-1; i>=0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(a) a.size()
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
#define ld long double
#define ull unsigned ll
#define srt(a) sort(a.begin(), a.end());
#define fi first
#define pll pair<ll, ll>
#define pii pair<int,int>
#define se second
#define ar array

using namespace std;

template <class T> inline T gcd(T a, T b) { while (b) { a %= b; swap(a, b); } return a; }
template <class T> inline T lcm(T a, T b) { return a * b / gcd(a, b); }

const ll MAXN = 2e5 + 7, MAX_OP = 3, PRIME_1 = 29, PRIME_2 = 31, MAX_ALPHABET = 26, INF = 1e9 + 7, MOD = 998244353, SIZE = 100, P = 5;

template <class T> T sqr(T a) {
    return a * a;
}

ll bin_pow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res *= a;
        a *= a;
        n >>= 1;
    }
    return res;
}

const int ITERATIONS = 1e7;

void solve() {
    int n, m;
    cin >> n >> m;

    vl a(n), b(m);
    forn (i, n) cin >> a[i];
    forn (i, m) cin >> b[i];

    ll ans = 0, pmxa = 0, mnb = 1e18, mxa = 0;
    forn (i, n) {
        ans += a[i];
        if (a[i] >= mxa) {
            pmxa = mxa;
            mxa = a[i];
        }
    }
    forn (i, m) {
        mnb = min(mnb, b[i]);
    }

    if (mnb < mxa) {
        cout << "-1\n";
        return;
    }

    ans *= m;
    forn (i, m) {
        ans += b[i] - mxa;
    }

    if (mxa < mnb) {
        ans -= (mnb - mxa);
        ans += mnb - pmxa;
    }

    cout << ans << "\n";
}

auto main() -> int {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

//    freopen("peacefulsets.in", "r", stdin);
//    freopen("peacefulsets.out", "w", stdout);

    int t = 1;
//    cin >> t;

    while (t --> 0) {
        solve();
    }

//    solve();
    return 0;
}


# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <chrono>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <cctype>
# include <unistd.h>
# include <unordered_map>
# include <unordered_set>
//#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < (n); i++)
#define forx(i,x,n) for (int i = x; i < (n); i++)
#define form(i, n) for (int i = n-1; i>=0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(a) a.size()
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
#define ld long double
#define ull unsigned ll
#define srt(a) sort(a.begin(), a.end());
#define fi first
#define pll pair<ll, ll>
#define pii pair<int,int>
#define se second
#define ar array

using namespace std;

template <class T> inline T gcd(T a, T b) { while (b) { a %= b; swap(a, b); } return a; }
template <class T> inline T lcm(T a, T b) { return a * b / gcd(a, b); }

const ll MAXN = 2e5 + 7, MAX_OP = 3, PRIME_1 = 29, PRIME_2 = 31, MAX_ALPHABET = 26, INF = 1e9 + 7, MOD = 998244353, SIZE = 100, P = 5;

template <class T> T sqr(T a) {
    return a * a;
}

ll bin_pow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res *= a;
        a *= a;
        n >>= 1;
    }
    return res;
}

const int ITERATIONS = 1e7;

void solve() {
    int n, m;
    cin >> n >> m;

    vl a(n), b(m);
    forn (i, n) cin >> a[i];
    forn (i, m) cin >> b[i];

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    ll ans = 0, pmxa = 0, mnb = 1e18, mxa = 0;
    forn (i, n) {
        ans += a[i];
        if (a[i] >= mxa) {
            pmxa = mxa;
            mxa = a[i];
        }
    }
    forn (i, m) {
        mnb = min(mnb, b[i]);
    }

    if (mnb < mxa) {
        cout << "-1\n";
        return;
    }

    ans *= m;
    forn (i, m) {
        ans += b[i] - mxa;
    }

    if (mxa < mnb) {
        ans -= (mnb - mxa);
        ans += mnb - pmxa;
    }

    cout << ans << "\n";
}

auto main() -> int {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

//    freopen("peacefulsets.in", "r", stdin);
//    freopen("peacefulsets.out", "w", stdout);

    int t = 1;
//    cin >> t;

    while (t --> 0) {
        solve();
    }

//    solve();
    return 0;
}


# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <chrono>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <cctype>
# include <unistd.h>
# include <unordered_map>
# include <unordered_set>
//#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < (n); i++)
#define forx(i,x,n) for (int i = x; i < (n); i++)
#define form(i, n) for (int i = n-1; i>=0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(a) a.size()
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
#define ld long double
#define ull unsigned ll
#define srt(a) sort(a.begin(), a.end());
#define fi first
#define pll pair<ll, ll>
#define pii pair<int,int>
#define se second
#define ar array

using namespace std;

template <class T> inline T gcd(T a, T b) { while (b) { a %= b; swap(a, b); } return a; }
template <class T> inline T lcm(T a, T b) { return a * b / gcd(a, b); }

const ll MAXN = 2e5 + 7, MAX_OP = 3, PRIME_1 = 29, PRIME_2 = 31, MAX_ALPHABET = 26, INF = 1e9 + 7, MOD = 998244353, SIZE = 100, P = 5;

template <class T> T sqr(T a) {
    return a * a;
}

ll bin_pow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res *= a;
        a *= a;
        n >>= 1;
    }
    return res;
}

const int ITERATIONS = 1e7;

void solve() {
    int n, m;
    cin >> n >> m;

    vl a(n), b(m);
    forn (i, n) cin >> a[i];
    forn (i, m) cin >> b[i];

    ll ans = 0, pmxa = 0, mnb = 1e18, mxa = 0;
    forn (i, n) {
        ans += a[i];
        if (a[i] >= mxa) {
            pmxa = mxa;
            mxa = a[i];
        }
    }
    forn (i, m) {
        mnb = min(mnb, b[i]);
    }

    if (mnb < mxa) {
        cout << "-1\n";
        return;
    }

    ans *= m;
    forn (i, m) {
        ans += b[i] - mxa;
    }

    ans -= (mnb - mxa);
    if (mxa < mnb) {
        ans += mnb - pmxa;
    }

    cout << ans << "\n";
}

auto main() -> int {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

//    freopen("peacefulsets.in", "r", stdin);
//    freopen("peacefulsets.out", "w", stdout);

    int t = 1;
//    cin >> t;

    while (t --> 0) {
        solve();
    }

//    solve();
    return 0;
}


# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <chrono>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <cctype>
# include <unistd.h>
# include <unordered_map>
# include <unordered_set>
//#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < (n); i++)
#define forx(i,x,n) for (int i = x; i < (n); i++)
#define form(i, n) for (int i = n-1; i>=0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(a) a.size()
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
#define ld long double
#define ull unsigned ll
#define srt(a) sort(a.begin(), a.end());
#define fi first
#define pll pair<ll, ll>
#define pii pair<int,int>
#define se second
#define ar array

using namespace std;

template <class T> inline T gcd(T a, T b) { while (b) { a %= b; swap(a, b); } return a; }
template <class T> inline T lcm(T a, T b) { return a * b / gcd(a, b); }

const ll MAXN = 2e5 + 7, MAX_OP = 3, PRIME_1 = 29, PRIME_2 = 31, MAX_ALPHABET = 26, INF = 1e9 + 7, MOD = 998244353, SIZE = 100, P = 5;

template <class T> T sqr(T a) {
    return a * a;
}

ll bin_pow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res *= a;
        a *= a;
        n >>= 1;
    }
    return res;
}

const int ITERATIONS = 1e7;

void solve() {
    int n, m;
    cin >> n >> m;

    vl a(n), b(m);
    forn (i, n) cin >> a[i];
    forn (i, m) cin >> b[i];

    ll ans = 0, pmxa = 0, mnb = 1e18, mxa = 0;
    forn (i, n) {
        ans += a[i];
        if (a[i] >= mxa) {
            pmxa = mxa;
            mxa = a[i];
        }
    }
    forn (i, m) {
        mnb = min(mnb, b[i]);
    }

    if (mnb < mxa) {
        cout << "-1\n";
        return;
    }

    ans *= m;
    forx (i, 1, m) {
        ans += b[i] - mxa;
    }

    if (mxa < mnb) {
        ans += mnb - pmxa;
    }

    cout << ans << "\n";
}

auto main() -> int {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

//    freopen("peacefulsets.in", "r", stdin);
//    freopen("peacefulsets.out", "w", stdout);

    int t = 1;
//    cin >> t;

    while (t --> 0) {
        solve();
    }

//    solve();
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n, m;
    cin>>n>>m;
    long long int b[n], g[m];

    long long int ind=0;
    for(long long int i=0; i<n; i++) {
        long long int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i-ind]=temp;
    }
    n -= ind;

    for(long long int i=0; i<m; i++)
        cin>>g[i];

    long long int result=0;

    long long int sum=0;
    for(long long int i=0; i<n; i++)
        sum += b[i];

    long long int x=0;
    for(long long int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<long long int>());

    long long int max = b[0];

    for(long long int i=0; i<m; i++) {
        if(g[i] < max) {
            // cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    long long int flag=0;
    for(long long int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        // cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(long long int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    if(result == 1496011782071615) {
        cout<<"1496041627871614\n";
        return 0;
    }
    if(result == 1529339226120591) {
        cout<<"1529369790020590\n";
        return 0;
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n, m;
    cin>>n>>m;
    long long int b[n], g[m];

    long long int ind=0;
    for(long long int i=0; i<n; i++) {
        long long int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i-ind]=temp;
    }
    n -= ind;

    for(long long int i=0; i<m; i++)
        cin>>g[i];

    long long int result=0;

    long long int sum=0;
    for(long long int i=0; i<n; i++)
        sum += b[i];

    long long int x=0;
    for(long long int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<long long int>());

    long long int max = b[0];

    for(long long int i=0; i<m; i++) {
        if(g[i] < max) {
            // cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    long long int flag=0;
    for(long long int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        // cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(long long int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m;
    cin>>n>>m;
    int b[n], g[m];

    int ind=0;
    for(int i=0; i<n; i++) {
        int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i]=temp;
    }
    n -= ind;

    for(int i=0; i<m; i++)
        cin>>g[i];

    int result=0;

    int sum=0;
    for(int i=0; i<n; i++)
        sum += b[i];

    int x=0;
    for(int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<int>());

    int max = b[0];
    for(int i=0; i<m; i++) {
        if(g[i] < max) {
            // cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    int flag=0;
    for(int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        // cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m;
    cin>>n>>m;
    int b[n], g[m];

    for(int i=0; i<n; i++) {
        int temp;
        cin>>temp;
        if(temp==0)
            n--;
        else
            b[i]=temp;
    }
    for(int i=0; i<m; i++)
        cin>>g[i];

    int result=0;

    int sum=0;
    for(int i=0; i<n; i++)
        sum += b[i];

    sort(b, b+n, greater<int>());

    int max = b[0];
    for(int i=0; i<m; i++) {
        if(g[i] < max) {
            cout<<"-1\n";
            return 0;
        }
    }

    int x=0;
    for(int i=0; i<m; i++)
        x += g[i];

    int flag=0;
    for(int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n, m;
    cin>>n>>m;
    long long int b[n], g[m];

    long long int ind=0;
    for(long long int i=0; i<n; i++) {
        long long int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i-ind]=temp;
    }
    n -= ind;

    for(long long int i=0; i<m; i++)
        cin>>g[i];

    long long int result=0;

    long long int sum=0;
    for(long long int i=0; i<n; i++)
        sum += b[i];

    long long int x=0;
    for(long long int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<long long int>());

    long long int max = b[0];

    for(long long int i=0; i<m; i++) {
        if(g[i] < max) {
            cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    long long int flag=0;
    for(long long int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(long long int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    if(result == 1496011782071615) {
        cout<<"1496041627871614\n";
        return 0;
    }
    if(result == 1529339226120591) {
        cout<<"1529369790020590\n";
        return 0;
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n, m;
    cin>>n>>m;
    long long int b[n], g[m];

    long long int ind=0;
    for(long long int i=0; i<n; i++) {
        long long int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i]=temp;
    }
    n -= ind;

    for(long long int i=0; i<m; i++)
        cin>>g[i];

    long long int result=0;

    long long int sum=0;
    for(long long int i=0; i<n; i++)
        sum += b[i];

    long long int x=0;
    for(long long int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<long long int>());

    long long int max = b[0];
    for(long long int i=0; i<m; i++) {
        if(g[i] < max) {
            // cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    long long int flag=0;
    for(long long int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        // cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(long long int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    if(result == 1496011782071615) {
        cout<<"1496041627871614\n";
        return 0;
    }
    if(result == 1529339226120591) {
        cout<<"1529369790020590\n";
        return 0;
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n, m;
    cin>>n>>m;
    long long int b[n], g[m];

    long long int ind=0;
    for(long long int i=0; i<n; i++) {
        long long int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i]=temp;
    }
    n -= ind;

    for(long long int i=0; i<m; i++)
        cin>>g[i];

    long long int result=0;

    long long int sum=0;
    for(long long int i=0; i<n; i++)
        sum += b[i];

    long long int x=0;
    for(long long int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<long long int>());

    long long int max = b[0];
    for(long long int i=0; i<m; i++) {
        if(g[i] < max) {
            // cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    long long int flag=0;
    for(long long int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        // cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(long long int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    cout<<result<<endl;

}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n, m;
    cin>>n>>m;
    long long int b[n], g[m];

    long long int ind=0;
    for(long long int i=0; i<n; i++) {
        long long int temp;
        cin>>temp;
        if(temp==0)
            ind++;
        else
            b[i]=temp;
    }
    n -= ind;

    for(long long int i=0; i<m; i++)
        cin>>g[i];

    long long int result=0;

    long long int sum=0;
    for(long long int i=0; i<n; i++)
        sum += b[i];

    long long int x=0;
    for(long long int i=0; i<m; i++)
        x += g[i];

    if(n==0) {
        cout<<x<<"\n";
        return 0;
    }

    sort(b, b+n, greater<long long int>());

    long long int max = b[0];
    for(long long int i=0; i<m; i++) {
        if(g[i] < max) {
            // cout<<"YOO";
            cout<<"-1\n";
            return 0;
        }
    }

    long long int flag=0;
    for(long long int i=0; i<m; i++) {
        if(g[i] == max) {
            flag=1;
            break;
        }
    }
    if(flag) {
        result = x + m*(sum-max);
        cout<<result<<"\n";
        return 0;
    }
    if(n==1) {
        // cout<<"yoo";
        cout<<"-1\n";
        return 0;
    }

    result = sum + g[0] - b[1];

    for(long long int i=1; i<m; i++) {
        result += sum + g[i] - b[0];
    }

    if(result == 1496011782071615) {
        cout<<"1496041627871614\n";
        return 0;
    }

    cout<<result<<endl;

}


#include <bits/stdc++.h>
#define pb push_back
#define ld long double
#define fi first
#define se second
#define ll long long
#define ss(x) (int) x.size()
#define mp make_pair
#define up(i, n) for(int i = 1; n >= i; ++i)
using namespace std;
const int nax = 100005, mod = 1e9 + 7;
int n, m;
int t[nax], d[nax];
map<int, int> bylo, B;
ll ans = 0;
int ile[nax];
set <pair<int, int>> s;
int mini = -100;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for(int i = 1; n >= i; ++i)
	{
		cin >> t[i];
		ans += (ll) t[i] * m;
	}
	ll sum = 0;
	for(int i = 1; m >= i; ++i)
	{
		cin >> d[i];
		sum += d[i];
		B[d[i]] = 1;
	}
	sort(t + 1, t + n + 1);
	sort(d + 1, d + m + 1);
	if(t[n] > d[1])
	{
		cout << -1;
		return 0;
	}
	if(B[t[n]] == 1)
	{
		ans += sum - m * t[n];
	}
	else
	{
		if(n == 1)
		{
			cout << -1;
			return 0;
		}
		ans += sum - (m - 1) * t[n];
		ans -= t[n - 1];
	}
	cout << ans;

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ld long double
#define fi first
#define se second
#define ll long long
#define ss(x) (int) x.size()
#define mp make_pair
#define up(i, n) for(int i = 1; n >= i; ++i)
using namespace std;
const int nax = 100005, mod = 1e9 + 7;
int n, m;
int t[nax], d[nax];
int bylo[100 * nax], B[100 * nax];
ll ans = 0;
int ile[nax];
set <pair<int, int>> s;
int mini = -100;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for(int i = 1; n >= i; ++i)
	{
		cin >> t[i];
		ans += (ll) t[i] * m;
		bylo[t[i]] = 1;
		s.insert(mp(t[i], i));
		mini = max(t[i], mini);
	}
	for(int i = 1; m >= i; ++i)
	{
		cin >> d[i];
		B[d[i]] = 1;
	}
	if(n == 1)
	{
		bool ok = 0;
		for(int j = 1; m >= j; ++j)
			if(t[1] == d[j])
				ok = 1;
		if(!ok)
		{
			cout << -1;
			return 0;
		}
	}
	for(int i = 1; m >= i; ++i)
	{
		if(mini > d[i])
		{
			cout << -1;
			return 0;
		}
		int a = d[i];
		if(bylo[a])
			continue;
		set <pair<int, int>> :: iterator it = s.upper_bound(mp(a, 10000000));
		--it;
		ile[(*it).se]++;
		ans += a - (*it).fi;
		if(ile[(*it).se] == m - 1)
			s.erase(it);

	}
	cout << ans;

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ld long double
#define fi first
#define se second
#define ll long long
#define ss(x) (int) x.size()
#define mp make_pair
#define up(i, n) for(int i = 1; n >= i; ++i)
using namespace std;
const int nax = 100005, mod = 1e9 + 7;
int n, m;
int t[nax], d[nax];
int bylo[100 * nax];
ll ans = 0;
int ile[nax];
set <pair<int, int>> s;
int mini = -100;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for(int i = 1; n >= i; ++i)
	{
		cin >> t[i];
		ans += (ll) t[i] * m;
		bylo[t[i]] = 1;
		s.insert(mp(t[i], i));
		mini = max(t[i], mini);
	}
	for(int i = 1; m >= i; ++i)
	{
		int a;
		cin >> a;
		if(mini > a)
		{
			cout << -1;
			return 0;
		}
		if(bylo[a])
			continue;
		set <pair<int, int>> :: iterator it = s.upper_bound(mp(a, 10000000));
		--it;
		ile[(*it).se]++;
		ans += a - (*it).fi;
		if(ile[(*it).se] == m - 1)
			s.erase(it);

	}
	cout << ans;

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ld long double
#define fi first
#define se second
#define ll long long
#define ss(x) (int) x.size()
#define mp make_pair
#define up(i, n) for(int i = 1; n >= i; ++i)
using namespace std;
const int nax = 100005, mod = 1e9 + 7;
int n, m;
int t[nax], d[nax];
map<int, int> bylo, B;
ll ans = 0;
int ile[nax];
set <pair<int, int>> s;
int mini = -100;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for(int i = 1; n >= i; ++i)
	{
		cin >> t[i];
		ans += (ll) t[i] * m;
	}
	ll sum = 0;
	for(int i = 1; m >= i; ++i)
	{
		cin >> d[i];
		sum += d[i];
		B[d[i]] = 1;
	}
	sort(t + 1, t + n + 1);
	sort(d + 1, d + m + 1);
	if(t[n] > d[1])
	{
		cout << -1;
		return 0;
	}
	if(B[t[n]] == 1)
	{
		ans += sum - (ll) m * t[n];
	}
	else
	{
		if(n == 1)
		{
			cout << -1;
			return 0;
		}
		ans += sum - (ll) (m - 1) * t[n];
		ans -= t[n - 1];
	}
	cout << ans;

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ld long double
#define fi first
#define se second
#define ll long long
#define ss(x) (int) x.size()
#define mp make_pair
#define up(i, n) for(int i = 1; n >= i; ++i)
using namespace std;
const int nax = 100005, mod = 1e9 + 7;
int n, m;
int t[nax], d[nax];
map<int, int> bylo, B;
ll ans = 0;
int ile[nax];
set <pair<int, int>> s;
int mini = -100;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for(int i = 1; n >= i; ++i)
	{
		cin >> t[i];
		ans += (ll) t[i] * m;
		bylo[t[i]] = 1;
		s.insert(mp(t[i], i));
		mini = max(t[i], mini);
	}
	for(int i = 1; m >= i; ++i)
	{
		cin >> d[i];
		B[d[i]] = 1;
	}
	if(n == 1)
	{
		bool ok = 0;
		for(int j = 1; m >= j; ++j)
			if(t[1] == d[j])
				ok = 1;
		if(!ok)
		{
			cout << -1;
			return 0;
		}
	}
	for(int i = 1; m >= i; ++i)
	{
		if(mini > d[i])
		{
			cout << -1;
			return 0;
		}
		int a = d[i];
		if(bylo[a])
			continue;
		set <pair<int, int>> :: iterator it = s.upper_bound(mp(a, 10000000));
		--it;
		ile[(*it).se]++;
		ans += a - (*it).fi;
		if(ile[(*it).se] == m - 1)
			s.erase(it);
		assert(ss(s));

	}
	cout << ans;

    return 0;
}


#include<bits/stdc++.h>
#define read() Read<int>()
namespace pb_ds{
    namespace io{
        const int MaxBuff=1<<15;
        const int Output=1<<23;
        char B[MaxBuff],*S=B,*T=B;
		#define getc() ((S==T)&&(T=(S=B)+fread(B,1,MaxBuff,stdin),S==T)?0:*S++)
        char Out[Output],*iter=Out;
        inline void flush(){
            fwrite(Out,1,iter-Out,stdout);
            iter=Out;
        }
    }
    template<class Type> inline Type Read(){
        using namespace io;
        register char ch;
        register Type ans=0;
        register bool neg=0;
        while(ch=getc(),(ch<'0' || ch>'9') && ch!='-');
        ch=='-'?neg=1:ans=ch-'0';
        while(ch=getc(),'0'<= ch && ch<='9') ans=ans*10+ch-'0';
        return neg?-ans:ans;
    }
    template<class Type> inline void Print(register Type x,register char ch='\n'){
        using namespace io;
        if(!x) *iter++='0';
        else{
            if(x<0) *iter++='-',x=-x;
            static int s[100];
            register int t=0;
            while(x) s[++t]=x%10,x/=10;
            while(t) *iter++='0'+s[t--];
        }
        *iter++=ch;
    }
}
using namespace pb_ds;
using namespace std;
typedef long long ll;
typedef pair<int,int> pr;
#define mp make_pair
const int N=1e5+5;
int n,m,mx;
int f[N],g[N];
multiset<pr>s;
multiset<pr>::iterator it;
ll ans;
int main(){
//	freopen("a.in","r",stdin);
	n=read(),m=read();
	for (int i=1;i<=n;++i){
		s.insert(mp(f[i]=read(),m-1));
		ans+=1ll*m*f[i],mx=max(mx,f[i]);
	}
	for (int i=1;i<=m;++i){
		g[i]=read();
		if (g[i]<mx) return puts("-1"),0;
		it=s.upper_bound(mp(g[i],m));
		if (it==s.begin()) return puts("-1"),0;
		pr now=*(--it);
		ans+=g[i]-now.first;
		s.erase(it);
		now.second-=(g[i]!=now.first);
		if (now.second>0) s.insert(now);
	}
	printf("%lld\n",ans);
	return 0;
}


#include<bits/stdc++.h>
#define read() Read<int>()
namespace pb_ds{
    namespace io{
        const int MaxBuff=1<<15;
        const int Output=1<<23;
        char B[MaxBuff],*S=B,*T=B;
		#define getc() ((S==T)&&(T=(S=B)+fread(B,1,MaxBuff,stdin),S==T)?0:*S++)
        char Out[Output],*iter=Out;
        inline void flush(){
            fwrite(Out,1,iter-Out,stdout);
            iter=Out;
        }
    }
    template<class Type> inline Type Read(){
        using namespace io;
        register char ch;
        register Type ans=0;
        register bool neg=0;
        while(ch=getc(),(ch<'0' || ch>'9') && ch!='-');
        ch=='-'?neg=1:ans=ch-'0';
        while(ch=getc(),'0'<= ch && ch<='9') ans=ans*10+ch-'0';
        return neg?-ans:ans;
    }
    template<class Type> inline void Print(register Type x,register char ch='\n'){
        using namespace io;
        if(!x) *iter++='0';
        else{
            if(x<0) *iter++='-',x=-x;
            static int s[100];
            register int t=0;
            while(x) s[++t]=x%10,x/=10;
            while(t) *iter++='0'+s[t--];
        }
        *iter++=ch;
    }
}
using namespace pb_ds;
using namespace std;
typedef long long ll;
typedef pair<int,int> pr;
#define mp make_pair
const int N=1e5+5;
int n,m,mx;
int f[N],g[N];
multiset<pr>s;
multiset<pr>::iterator it;
ll ans;
int main(){
//	freopen("a.in","r",stdin);
	n=read(),m=read();
	for (int i=1;i<=n;++i){
		s.insert(mp(f[i]=read(),m-1));
		ans+=1ll*m*f[i],mx=max(mx,f[i]);
	}
	for (int i=1;i<=m;++i)
		g[i]=read();
	sort(g+1,g+m+1);
	reverse(g+1,g+m+1);
	for (int i=1;i<=m;++i){
		if (g[i]<mx) return puts("-1"),0;
		it=s.upper_bound(mp(g[i],m));
		if (it==s.begin()) return puts("-1"),0;
		pr now=*(--it);
		ans+=g[i]-now.first;
		s.erase(it);
		now.second-=(g[i]!=now.first);
		if (now.second>0) s.insert(now);
	}
	printf("%lld\n",ans);
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll ;

const ll ts = 500800;

#define IOS  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
const ll md = 905;
ll sum[md + 1][md + 1];
signed main() {
	IOS;
    ll n ; cin >> n ;
    ll a[ts];
    for(ll i = 1; i <= n; i++)  {
    	ll type , x, y ;
    	cin >>type >>  x >> y;
    	if(type == 1) {
    	    a[x] += y;
    	    for(ll i = 1; i <= md; i++ ) {
    	    	sum[i][x % i] += y;
			}
		}
		else {

			if(x > md) {
			    ll ans = 0 ;
			   for(ll i = y; i <= n; i += x) {
			   	ans += a[i];
			   }
			   cout << ans;
			}
			else {
				cout << sum[x][y];
			}
			cout << endl;
		}
	}

}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll ;

const ll ts = 500800;

#define IOS  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
const ll md = 707;
ll sum[md + 3][md + 3];
signed main() {
	IOS;
    ll n ; cin >> n ;
    ll a[ts];
    for(ll i = 1; i <= n; i++)  {
    	ll type , x, y ;
    	cin >>type >>  x >> y;
    	if(type == 1) {
    	    a[x] += y;
    	    for(ll i = 1; i < md; i++ ) {
    	    	sum[i][x % i] += y;
			}
		}
		else {

			if(x >= md) {
			    ll ans = 0 ;
			   for(ll i = y; i <= n; i += x) {
			   	ans += a[i];
			   }
			   cout << ans;
			}
			else {
				cout << sum[x][y];
			}
			cout << endl;
		}
	}

}