------
## 最终结论
```python
def numMusicPlaylists(N, L, K):
    MOD = 10**9 + 7
    
    # dp[i][j] represents the number of playlists of length j using exactly i different songs
    dp = [[0] * (L + 1) for _ in range(N + 1)]
    
    # Base case: there's one way to create a playlist of length 0 with 0 songs
    dp[0][0] = 1
    
    for i in range(1, N + 1):  # i is the number of different songs used
        for j in range(1, L + 1):  # j is the length of the playlist
            # Adding a new song that hasn't been used yet
            dp[i][j] += dp[i - 1][j - 1] * (N - (i - 1)) % MOD
            
            # Replaying a song that has already been used
            if i > K:  # we can only replay if we have more than K songs
                dp[i][j] += dp[i][j - 1] * (i - K) % MOD
            
            dp[i][j] %= MOD
            
    return dp[N][L]

# Example usage:
print(numMusicPlaylists(3, 3, 1))  # Output: 6
print(numMusicPlaylists(2, 3, 0))  # Output: 6
print(numMusicPlaylists(2, 3, 1))  # Output: 2
```