<p>You are given three integers <code>n</code>, <code>m</code> and <code>k</code>. Consider the following algorithm to find the maximum element of an array of positive integers:</p>
<p>You should build the array arr which has the following properties:</p>
<ul>
<li><code>arr</code> has exactly <code>n</code> integers.</li>
<li><code>1 <= arr[i] <= m</code> where <code>(0 <= i < n)</code>.</li>
<li>After applying the mentioned algorithm to <code>arr</code>, the value <code>search_cost</code> is equal to <code>k</code>.</li>
</ul>
<p>Return <em>the number of ways</em> to build the array <code>arr</code> under the mentioned conditions. As the answer may grow large, the answer <strong>must be</strong> computed modulo <code>10<sup>9</sup> + 7</code>.</p>