Token Transfer#4495

Token Transfer

5 seconds
128 megabytes
Medium

Two friends are playing a strategic board game called "Token Transfer." The game is played on a linear board with numbered squares.

Game rules: The board has squares, numbered from left to right. Each square contains a certain number of tokens (possibly none). On each turn, a player must choose any square (except the first one) and move some tokens from it to the square immediately to its left. The player who cannot make a valid move loses the game.

Game setup: The players have a collection of numbered cards, where each card shows a number representing how many tokens to place on a square. Player One selects a contiguous range of cards from position to position (inclusive) and places tokens on the board squares according to the numbers on the cards. Player Two then chooses one additional card from the remaining cards and adds the final square to the board with the corresponding number of tokens. The resulting board configuration becomes the starting position for the game. Player One always makes the first move in the game.

Your task is to determine whether Player Two can choose their card strategically so that they are guaranteed to win, regardless of how Player One plays.

Input

The first line contains (1 \leq N \leq 10^6) - the total number of cards in the collection. The second line contains integers representing the values on these cards. The third line contains (1 \leq M \leq 10^5) - the number of queries.

Each of the next lines contains three integers , , (each not exceeding 10^9):

  • If x = 1: This is a game query. The values and specify which cards Player One selected (positions through ). Output "Yes" if Player Two can choose the final card to guarantee a win, or "No" otherwise. It is guaranteed that at least one card remains for Player Two to choose.

  • If x = 2: This is an update query. The card at position has its value changed to .

Output

For each query where x = 1, output "Yes" or "No" on a separate line.

Examples

Example 1

Loading
Loading