LearnPy Hub
← Arena
AdvancedRating 1700

Palindrome After k Deletions?

Can you delete at most k characters from the string so that what remains reads the same backwards? Print YES or NO.

Input

The string (length ≤ 1000), then k.

Output

YES or NO.

Sample 1

Input
abcdeca
2
Output
YES

Sample 2

Input
abbababa
1
Output
YES
solution.py
Output appears here
Palindrome After k Deletions? · Python Arena problem · LearnPy Hub