Andrey thinks he is truly a successful developer, but in reality he didn't know about the binary search algorithm until recently. After reading some literature Andrey understood that this algorithm allows to quickly find a certain number $x$ in an array. For an array $a$ indexed from zero, and an integer $x$ the pseudocode of the algorithm is as follows:

BinarySearch(a, x)
  left = 0
  right = a.size()
  while left < right
    middle = (left + right) / 2
    if a[middle] <= x then
      left = middle + 1
    else
      right = middle
  
  if left > 0 and a[left - 1] == x then
    return true
  else
    return false

Note that the elements of the array are indexed from zero, and the division is done in integers (rounding down).

Andrey read that the algorithm only works if the array is sorted. However, he found this statement untrue, because there certainly exist unsorted arrays for which the algorithm find $x$!

Andrey wants to write a letter to the book authors, but before doing that he must consider the permutations of size $n$ such that the algorithm finds $x$ in them. A permutation of size $n$ is an array consisting of $n$ distinct integers between $1$ and $n$ in arbitrary order.

Help Andrey and find the number of permutations of size $n$ which contain $x$ at position $pos$ and for which the given implementation of the binary search algorithm finds $x$ (returns true). As the result may be extremely large, print the remainder of its division by $10^9+7$.


-----Input-----

The only line of input contains integers $n$, $x$ and $pos$ ($1 \le x \le n \le 1000$, $0 \le pos \le n - 1$) — the required length of the permutation, the number to search, and the required position of that number, respectively.


-----Output-----

Print a single number — the remainder of the division of the number of valid permutations by $10^9+7$.


-----Examples-----
Input
4 1 2

Output
6

Input
123 42 24

Output
824071958



-----Note-----

All possible permutations in the first test case: $(2, 3, 1, 4)$, $(2, 4, 1, 3)$, $(3, 2, 1, 4)$, $(3, 4, 1, 2)$, $(4, 2, 1, 3)$, $(4, 3, 1, 2)$.

Difficulty: interview

Starter code:

Solutions:
MOD = 1000000007


def f(n, cnt):
    """
    n! / (n - cnt)!
    """
    ans = 1
    for _ in range(cnt):
        ans = (ans * n) % MOD
        n -= 1
    return ans


def main():
    n, x, pos = list(map(int, input().split()))
    chk1 = 0
    chk_r = 0
    left = 0
    right = n
    while left < right:
        middle = (left + right) // 2
        if middle <= pos:
            if middle < pos:
                chk1 += 1
            left = middle + 1
        else:
            chk_r += 1
            right = middle
    if chk1 > x - 1 or chk_r > n - x:
        print(0)
    else:
        # (x - 1)! / (x - 1 - chk1)! * (n - x)! / (n - x - chk_r)! * (n - chk1 - chk_r - 1)!
        rest = n - chk1 - chk_r - 1
        print(f(x - 1, chk1) * f(n - x, chk_r) * f(rest, rest) % MOD)


main()



n, x, p = list(map(int, input().split()))

smallc = 0
largec = 0

left = 0
right = n
while left < right:
    mid = (left + right) // 2
    if mid < p:
        smallc += 1
        left = mid + 1
    elif mid > p:
        largec += 1
        right = mid
    else:
        left = mid + 1

largeAv = n - x
smallAv = x - 1

#print(smallc, smallAv)
#print(largec, largeAv)

mod = 1000000007

def permutations(n, c):
    v = 1
    for i in range(n - c + 1, n + 1):
        v = (v * i) % mod
    return v

v = permutations(largeAv, largec) * permutations(smallAv, smallc) % mod
oc = n - (largec + smallc + 1)
v = v * permutations(oc, oc) % mod


#print(permutations(largeAv, largec), permutations(smallAv, smallc), permutations(oc, oc))
print(v)


n,x,pos = list(map(int,input().split()))

a = [i for i in range(n)]

zero = 0
one = 0

left = 0
right = n
while left<right:
    middle = (left + right)//2
    if a[middle]<=pos:
        zero += 1
        left = middle+1
    else:
        one += 1
        right = middle

res = 1
mod = 10**9+7
for i in range(zero-1):
    res *= (x-1-i)
    res %= mod
for i in range(one):
    res *= (n-x-i)
    res %= mod

for j in range(n-zero-one):
    res *= j+1
    res %= mod

print(res)


from math import factorial
mod = 1000000007

n, x, pos = list(map(int, input().split()))
biggerNeeded = 0
lowerNeeded = 0
left = 0
right = n
while left < right:
    #print(left, right)
    middle = (left+right)//2
    if middle < pos:
        left = middle + 1
        lowerNeeded += 1
    elif middle > pos:
        right = middle
        biggerNeeded += 1
    else:
        left = middle + 1
if x+biggerNeeded > n or x-lowerNeeded <= 0:
    print(0)
    return
ans = factorial(x-1) // factorial(x-1-lowerNeeded)
ans %= mod
ans *= factorial(n-x) // factorial(n-x-biggerNeeded)
ans %= mod
ans *= factorial(n-biggerNeeded-lowerNeeded-1)
ans %= mod
print(ans)


import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7
N = 2000
fact = [0 for _ in range(N)]
invfact = [0 for _ in range(N)]
fact[0] = 1
for i in range(1, N):
    fact[i] = fact[i - 1] * i % MOD

invfact[N - 1] = pow(fact[N - 1], MOD - 2, MOD)

for i in range(N - 2, -1, -1):
    invfact[i] = invfact[i + 1] * (i + 1) % MOD
def nCk(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return fact[n] * invfact[k] * invfact[n - k] % MOD

def main():
    n, x, pos = map(int, input().split())
    b = 0
    s = 0
    l = 0
    r = n
    while l < r:
        m = (l + r) // 2
        if m <= pos:
            l = m + 1
            if m != pos:
                s += 1
        else:
            r = m
            if m != pos:
                b += 1
        
    b_cnt = n - x
    s_cnt = x - 1
    c = n - 1 - b - s
    ans = fact[c] * nCk(b_cnt, b) * nCk(s_cnt, s) * fact[b] * fact[s]
    print(ans % MOD)
    
for _ in range(1):
    main()

import sys
input = sys.stdin.readline

n,x,pos=list(map(int,input().split()))
mod=10**9+7

ANS=[0]*n

left=0
right=n

while left<right:
    #print(left,right)
    middle=(left+right)//2
    if pos>=middle:
        ANS[middle]=-1
        left=middle+1
    else:
        ANS[middle]=1
        right=middle

ANS[pos]=9
#print(ANS)

P=ANS.count(1)
M=ANS.count(-1)
MINUS=x-1
PLUS=n-x

A=1
for i in range(P):
    A=A*PLUS%mod
    PLUS-=1

#print(A)
for i in range(M):
    A=A*MINUS%mod
    MINUS-=1

#print(A)

for i in range(1,n-P-M):
    A=A*i%mod

print(A)