#include "bits/stdc++.h" /* #include "boost/multiprecision/cpp_int.hpp" namespace mp = boost::multiprecision; using i128=mp::cpp_int; */ using namespace std; typedef long long ll; typedef int64_t i64; typedef vector vi; typedef vector vvi; typedef vector vvvi; typedef vector vll; typedef vector vvll; typedef vector vvvll; typedef vector vs; typedef vector vc; typedef vector vvc; typedef vector vd; typedef vector vvd; #define rep(i,a,n) for(int i=a;in;i--) #define yes(ans) if(ans)cout<<"yes"<>n>>q; vvi a(n,vi(2)); rep(i,0,n){cin>>a[i][0]; a[i][0]=1000000000-a[i][0]; a[i][1]=i;} so(a); vi top(n),bot(n); int x=-1; vi now(0); rep(i,0,n){ if(x==a[i][0]){ now.push_back(a[i][1]); } else{ for(int j:now){ bot[j]=i-1; } x=a[i][0]; now={a[i][1]}; } if(i==n-1){ for(int j:now){ bot[j]=i; } } } x=-1; now={}; drep(i,n-1,-1){ if(x==a[i][0]){ now.push_back(a[i][1]); } else{ for(int j:now){ top[j]=i+1; } x=a[i][0]; now={a[i][1]}; } if(i==0){ for(int j:now){ top[j]=i; } } } //rep(i,0,n) cout<>k>>l; k--; l--; if(top[k]>=top[l]) cout<<0<