#include #define ALL(v) std::begin(v),std::end(v) using lint=long long; using lubl=long double; int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint n;std::cin>>n; std::vectord(n); for(lint&e:d)std::cin>>e; lint x,y;std::cin>>x>>y; if(x==0&&y==0){ std::cout<<0<<'\n'; return 0; } if(std::count(ALL(d),std::abs(x)+std::abs(y))){ std::cout<<1<<'\n'; return 0; } lint max=*std::max_element(ALL(d)); std::cout<