#include using namespace std; int main() { int n, m; cin>>n>>m; vector a(n); for(auto& e: a) cin>>e; vector> edges; while (m--) { int u, v; cin>>u>>v; edges.emplace_back(--u, --v); edges.emplace_back(v, u); } auto is_kadomatsu=[&](int i, int j, int k) { return (a[i]a[k] or a[i]>a[j] and a[j]