def f(m,n):
    if n == 1:
        return m
    return m * f(m-1,n-1)


m,n = map(int,input().split())
print(f(m,n))