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

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static int[][] combination() {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static int[][] combination() {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	} try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int[][] combination = combination(); combination combination() combination int N = 0; N 0 int M = 0; M 0 if (n >= 2) {
				N = combination[n][2] % 1000000007;
			} n >= 2 n 2 {
				N = combination[n][2] % 1000000007;
			} N = combination[n][2] % 1000000007 N combination[n][2] % 1000000007 combination[n][2] combination[n] combination n 2 1000000007 if (m >= 2) {
				M = combination[m][2] % 1000000007;
			} m >= 2 m 2 {
				M = combination[m][2] % 1000000007;
			} M = combination[m][2] % 1000000007 M combination[m][2] % 1000000007 combination[m][2] combination[m] combination m 2 1000000007 int RES = N + M; RES N + M N M System.out.println(RES) System.out.println System.out System System.out RES String[] args args public static int[][] combination() {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	} combination {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	} int combination[][] = new int[1001][1001]; combination new int[1001][1001] 1001 1001 for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			} int i = 0; int i = 0; i 0 i < 1001 i 1001 i++ i++ i for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			} for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			} int j = 0; int j = 0; j 0 j <= i j i j++ j++ j {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			} {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			} if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007; j == 0 || j == i j == 0 j 0 j == i j i combination[i][j] = 1 combination[i][j] combination[i] combination i j 1 combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007 combination[i][j] combination[i] combination i j combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007 combination[i - 1][j - 1] % 1000000007 combination[i - 1][j - 1] combination[i - 1] combination i - 1 i 1 j - 1 j 1 1000000007 combination[i - 1][j] % 1000000007 combination[i - 1][j] combination[i - 1] combination i - 1 i 1 j 1000000007 return combination; combination public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static int[][] combination() {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	}
} public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static int[][] combination() {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {

			int n = scanner.nextInt();
			int m = scanner.nextInt();

			int[][] combination = combination();

			int N = 0;
			int M = 0;

			if (n >= 2) {
				N = combination[n][2] % 1000000007;
			}

			if (m >= 2) {
				M = combination[m][2] % 1000000007;
			}

			int RES = N + M;

			System.out.println(RES);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static int[][] combination() {
		int combination[][] = new int[1001][1001];
		for (int i = 0; i < 1001; i++)
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i)
					combination[i][j] = 1;
				else
					combination[i][j] = combination[i - 1][j - 1] % 1000000007 + combination[i - 1][j] % 1000000007;
			}
		return combination;
	}
}