Divide and print
- it was a basic problem.
- only implementation matters in this one.
- below is mine.
implementation
```cpp
string isFlexible(int n, vector arr) {
int i = 1;
while (i < n and arr[i - 1] < arr[i])
i++;
int stop_one = i;
while (i < n and arr[i - 1] == arr[i])
i++;
int stop_two = i;
if (stop_one == stop_two)
return "NO";
if (stop_two == n)
return "YES";
while (i < n and arr[i - 1] > arr[i])
i++;
return (i == n ? "YES" : "NO");
}
```
</details>