Killjee And Queries

0

0 votes
Very-Easy
Problem

Killjee has an array a containing n integers ai.

Now he has Q queries of two types

1 u val change au to val

2 u v val - check If val exist in subarray starting at index u and ending at index v.

INPUT

First Line of Input contain a single integer N.

Next line contains n space separated integres elements of array a.

Next Line Contains q number of queries.

Next q line queries as speciied in problem.

OUTPUT

For each query if val exist print YES else print NO

CONSTRAINTS

n105

ai1000

1q5106

Sample Input
5
1 2 3 4 5
6 
1 2 3
2 1 3 2
2 1 4 3
1 3 4
2 1 5 2
2 3 5 4
Sample Output
NO
YES
NO
YES
Time Limit: 4
Memory Limit: 768
Source Limit:
Editor Image

?