UNB CS2999 Week 10

Start

2019-11-18 07:00 AKST

UNB CS2999 Week 10

End

2019-11-25 07:00 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -269 days 18:32:54

Time elapsed

168:00:00

Time remaining

0:00:00

Problem A
Long Swaps

/problems/longswaps/file/statement/en/img-0001.jpg
Image by Nick Youngson

You have a string $s$ and you may modify it by making long swaps of its letters. Two letters can be swapped if their positions differ by at least $k$. That is, you may swap the $i$-th letter with the $j$-th letter in $s$ if $|i - j| \geq k$. Is it possible to sort all the letters in $s$ increasingly, if you are allowed to swap any number of times (possibly zero)?

Input

The first line has a string $s$ ($2 \leq |s| \leq 100$) and an integer $k$ ($1 \leq k \leq |s| - 1$), separated by a single space. The string $s$ consists of only lowercase letters.

Output

If it is possible to sort the letters increasingly, output “Yes”. Otherwise output “No”.

Sample Input 1 Sample Output 1
prognova 4
Yes
Sample Input 2 Sample Output 2
helloworld 6
No