import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static Map map = new HashMap<>(); static int fact(int n) { BigInteger result = BigInteger.ONE; for(int i = n; i > 1; i--) { if(map.containsKey(i)) { result = result.multiply(map.get(i)); break; } result = result.multiply(new BigInteger(String.valueOf(i))); } map.put(n, result); return result.mod(new BigInteger("100000007")).intValue(); } static long countArray(int n, int k, int x) { return (long)(n-2)*(k-1)%100000007-1; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int x = in.nextInt(); long answer = countArray(n, k, x); System.out.println(answer); in.close(); } }