---
# System prepended metadata

title: 競程三 -- 110550126 -- problem1

---

# 競程三 -- 110550126 -- problem1

## Problem Description
 Alex want to become a "dragon and lion dance" master, but he need to pratice jump from a pillar to another others specefic pillar and can't not jump to the pillar that have jumped before, and for every pratice there is n pillars and m valid way to jump from a pillar to another others specefic pillar.
  However Alex is just a rookie, he can only jump to the pillar which is lower than the pillar that he now at.
  He can decided any pillar where he start from. Please help Alex to find out how the length of longest pillow path that Alex can jump in this practice.
## input format
The first line contains two number $n$, $m$ — number of pillars and the number of valid jumping path.

The next line contains $n$ integers $w_1, w_2, \ldots, w_n$ — $w_i$ is the height of pillars $i$.

Each of the next $m$ lines contains two integers $a$, $b$ — canjump from pillar $a$ to $b$ or from pillar $b$ to pillar $a$.
## output format
Output an integer, which is the maximun length of Alex can jump.
## Technical Specification

- $1 \le n \le 200\,000$
- $1 \le m \le \min\left\{ \frac{n(n-1)}{2}, 200\,000 \right\}$

## Sample IO
```
=== Input1 ===
6 8
8 7 6 5 4 5
0 1
0 2
0 3
2 3
3 4
1 4
4 5
2 5
=== Output1 ===
4
=== Explain1 ===
//pillar:   0->2->3->4
//height:   8->6->5->4
```
```
=== Input2 ===
6 15
1 2 3 4 5 6 
0 1
0 2
0 3
0 4
0 5
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
=== Output2 ===
6
=== Explain2 ===
//pillar:   5->4->3->2->1->0
//height:   6->5->4->3->2->1
```
