#K43337. Defeating All Enemies on the Bridge
Defeating All Enemies on the Bridge
Defeating All Enemies on the Bridge
Ikta is standing on a narrow bridge that has n positions indexed from 0 to n-1. Enemies are approaching from both ends of the bridge. Ikta can only defeat them if she is positioned somewhere in the middle of the bridge. Specifically, if the length of the bridge is greater than 1 then Ikta must not start at either end (positions 0 and n-1) for her to successfully defeat all the enemies. Note that if the bridge length is 1, Ikta wins by default.
Your task is to determine whether Ikta can defeat all the enemies based on the bridge length and her starting position.
inputFormat
The input consists of two space-separated integers: n and p.
- n: The length of the bridge (an integer).
- p: Ikta's starting position on the bridge (an integer).
outputFormat
Output a single string: "YES" if Ikta can defeat all enemies, or "NO" if she cannot.
## sample5 2
YES