The first line contains the number of points N and the number of segments M (1≤N,M≤100000).
The second line contains the coordinates of the N points. No two points share a coordinate.
Each of the next M lines contains the start and the end of one segment. The start is less than or equal to the end.
Every coordinate in the input is a natural number not greater than 109.