import sys import math def fac(num): n = 1 while num > 0: n = n * num num = num - 1 return n def countArray(n, k, x): q=n-2 w=(fac(k)/fac(k-q)*fac(q))*fac(q) w=w%(7) return "%.0f" % w #k is the element,q is number of elemnets in between if __name__ == "__main__": n, k, x = input().strip().split(' ') n, k, x = [int(n), int(k), int(x)] answer = countArray(n, k, x) print(answer)