Under construction

Still being built. Things may change

Hold the Line

Interview

Time limit2sMemory limit1024 MB

Summary
Each update replaces the height at one position, and each query asks whether the whole line is in non-decreasing order.
Level

Easy3 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

Nick Fury decided that soldiers from the special forces unit of S.H.I.E.L.D. would help the Avengers fend off Loki's army. He will send nn soldiers into the attack, and all the others are needed elsewhere. All that remains is to choose which soldiers go.

Nick first picked nn soldiers at random and lined them up. Then he began replacing, one at a time, one of the selected soldiers with a soldier who is not currently in the line. The unit is large, and Nick does not know each soldier personally. He can judge the unit's fighting strength only by visible external signs. One important measure is whether the soldiers in the line stand in non-decreasing order of height.

Nick can issue two kinds of commands. The first command: a new soldier of height xx takes the place of the soldier standing at position kk. With the second command he asks whether the soldiers in the line stand in non-decreasing order of height. Process these commands and answer the queries.

Input

The first line contains two integers nn and mm (1≤n≤100 0001 \le n \le 100{\,}000, 0≤m≤200 0000 \le m \le 200{\,}000): the number of soldiers in the line and the number of commands Nick issues. The second line contains nn non-negative integers, none exceeding 10910^9, the initial heights of the soldiers.

Each of the next mm lines is a command. If the line starts with !, two integers kk and xx follow (1≤k≤n1 \le k \le n, 0≤x≤1090 \le x \le 10^9), meaning the soldier of height xx replaces the soldier at position kk. A line starting with ? is the second kind of command.

Output

For each second-type command, print <<YES>> on its own line if the soldiers in the line are currently in non-decreasing order of height, and <<NO>> otherwise.

Examples1

  1. Example 1

    Input
    5 5
    2 4 6 8 10
    ?
    ! 2 7
    ?
    ! 3 8
    ?
    
    Expected output
    YES
    NO
    YES