#include #include #define rep(i,n) for(int i=0;i vi; typedef vector vl; typedef vector> vvi; typedef vector> vvl; typedef long double ld; typedef pair P; template ostream& operator<<(ostream& os, const static_modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const dynamic_modint& a) {os << a.val(); return os;} template istream& operator>>(istream& is, static_modint& a) {long long x; is >> x; a = x; return is;} template istream& operator>>(istream& is, dynamic_modint& a) {long long x; is >> x; a = x; return is;} template istream& operator>>(istream& is, vector& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;} template ostream& operator<<(ostream& os, const pair& p){os << p.first << ' ' << p.second; return os;} template ostream& operator<<(ostream& os, const vector& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const vector>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;} template ostream& operator<<(ostream& os, const set& se){for(T x : se) os << x << " "; os << "\n"; return os;} template ostream& operator<<(ostream& os, const unordered_set& se){for(T x : se) os << x << " "; os << "\n"; return os;} template ostream& operator<<(ostream& os, const atcoder::segtree& seg){int n = seg.max_right(0, [](S){return true;}); rep(i, n) os << seg.get(i) << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const atcoder::lazy_segtree& seg){int n = seg.max_right(0, [](S){return true;}); rep(i, n) os << seg.get(i) << (i == n - 1 ? "\n" : " "); return os;} template void chmin(T& a, T b){a = min(a, b);} template void chmax(T& a, T b){a = max(a, b);} struct Query{ long long k, l, m, n, x; }; struct Rational{ long long up, down; Rational(long long _up, long long _down){ assert(_down != 0); int c = 1; if(_up < 0){c *= -1; _up *= -1;} if(_down < 0){c *= -1; _down *= -1;} long long g = gcd(_up, _down); up = c * _up / g; down = _down / g; } bool operator<(const Rational& right) const{ return up * right.down < right.up * down; } bool operator==(const Rational& right) const{ return (up * right.down - right.up * down) == 0; } }; // Coodinate Compression // https://youtu.be/fR3W5IcBGLQ?t=8550 template struct CC { bool initialized; vector xs; CC(): initialized(false) {} void add(T x) { xs.push_back(x);} void init() { sort(xs.begin(), xs.end()); xs.erase(unique(xs.begin(),xs.end()),xs.end()); initialized = true; } int operator()(T x) { if (!initialized) init(); return upper_bound(xs.begin(), xs.end(), x) - xs.begin() - 1; } T operator[](int i) { if (!initialized) init(); return xs[i]; } int size() { if (!initialized) init(); return xs.size(); } }; using S = pair; S op(S a, S b){ return make_pair(a.first + b.first, a.second + b.second); } S e(){ return make_pair(0LL, 0LL); } using F = pair; S mapping(F f, S x){ return make_pair(f.first + x.first, f.second + x.second); } F composition(F f, F g){ return make_pair(f.first + g.first, f.second + g.second); } F id(){ return make_pair(0LL, 0LL); } const long long INF = 1001001001; int main(){ int q; cin >> q; vector querys; CC cc; cc.add(Rational{-INF, 1}); cc.add(Rational{INF, 1}); rep(i, q){ long long k, l, m, n, x; cin >> k >> l >> m >> n >> x; querys.emplace_back(k, l, m, n, x); if(k != 0) cc.add(Rational{-l, k}); if(m != 0) cc.add(Rational{-n, m}); cc.add(Rational{x, 1}); } int sz = cc.size(); lazy_segtree seg(sz); /* for(auto rational : cc.xs){ cout << rational.up << ' ' << rational.down << "\n"; } */ // apply F(x) += c * max(kx + l, 0) auto add = [&](long long k, long long l, long long c){ if(k > 0){ seg.apply(cc(Rational(-l, k)), sz, make_pair(c * k, c * l)); } if(k == 0){ if(l > 0) seg.apply(0, sz, make_pair(0, c * l)); } if(k < 0){ seg.apply(0, cc(Rational(-l, k)), make_pair(c * k, c * l)); } }; auto judge = [&](long long x){ int idx = cc(Rational{x, 1}); auto line_left = seg.get(idx - 1); auto line_right = seg.get(idx); // cout << line_left << "\n"; // cout << line_right << "\n"; if(line_left != e()) return false; if(line_right != e()) return false; return true; }; rep(i, q){ auto [k, l, m, n, x] = querys[i]; add(k, l, 1); add(m, n, -1); if(judge(x)) cout << "Yes\n"; else cout << "No\n"; /* rep(idx, sz) cout << seg.get(idx) << ' '; cout << "\n"; */ } return 0; }