#include <iostream>
#include <vector>
#include <utility>
#include <complex>
#include <cassert>
using namespace std;
using W = long double;
using P = complex<W>;
using Poly = vector<P>;
using L = pair<P,P>;
#define X real()
#define Y imag()
constexpr W EPS = 1e-10, pi = acos(-1);

void debug(Poly p){
  cerr << "Polygon" << endl;
  for(auto e : p) cerr << e.X << " " << e.Y << endl;
  cerr << "..." << endl;
}

void debug(L l){
  fprintf(stderr,"Segment %Lf %Lf %Lf %Lf\n",l.first.X,l.first.Y,l.second.X,l.second.Y);
}

W dot(const P &a, const P &b){ return a.X*b.X + a.Y*b.Y; }
W cross(const P &a, const P &b){ return a.X*b.Y - a.Y*b.X; }

P intersection(const L &a, const L &b){
  P af = a.first, as = a.second, bf = b.first, bs = b.second;
  return af + cross(bs-bf,af-bf)/(-cross(bs-bf,as-bf)+cross(bs-bf,af-bf))*(as-af);
}

int ccw(P a, P b, P c){
  b -= a, c -= a;
  if(cross(b,c) > +EPS) return +1;
  if(cross(b,c) < -EPS) return -1;
  if(dot(b,c) < +EPS) return +2;
  if(norm(b) + EPS < norm(c)) return -2;
  return 0;
}

Poly convex_cut(const Poly &p, const L &l){
  Poly ret;
  int n = p.size();
  for(int i = 0; i < n; ++i){
    P cur = p[i], nex = p[(i+1)%n], lf = l.first, ls = l.second;
    if(ccw(lf,ls,cur) != -1)
      ret.push_back(cur);
    if((ccw(lf,ls,cur) != -1) ^ (ccw(lf,ls,nex) != -1))
      ret.push_back(intersection(L(cur,nex),l));
  }
  return ret;
}

bool is_cross(L a, L b){
  P af = a.first, as = a.second, bf = b.first, bs = b.second;
  return (ccw(af,as,bf)*ccw(af,as,bs) <= 0 && ccw(bf,bs,af)*ccw(bf,bs,as) <= 0);
}

W ps_dist(P a, L s){
  P sf = s.first, ss = s.second;
  if(dot(ss-sf,a-sf) >= 0 && dot(sf-ss,a-ss) >= 0)
    return abs(cross(sf-ss,a-ss))/abs(sf-ss);
  return min(abs(a-sf), abs(a-ss));
}

int in_poly(P a, const Poly &p){
  int n = p.size(), c = 0;
  for(int i = 0; i < n; ++i){
    P s = p[i]-a, t = p[(i+1)%n]-a;
    if(!ccw(s,t,P(0,0))) return 1;//辺上
    if(s.Y > t.Y + EPS) swap(s,t);
    if((s.Y*t.Y < 0 || (s.Y*t.Y < EPS && t.Y > EPS)) && cross(s,t) < EPS) ++c;
  }
  if(c%2) return 2;//内部
  return 0;//外部
}

W max_radius(const Poly &pol){
  size_t n = pol.size();
  vector<L> lines;
  for(size_t i = 0; i < n; ++i){
    P p = pol[i], q = pol[(i+1)%n], r = pol[(i+2)%n];
    lines.emplace_back(q,q+(p-q)/abs(p-q)+(r-q)/abs(r-q));
  }
  vector<P> cand;
  for(size_t i = 0; i < lines.size(); ++i){
    for(size_t j = 0; j < i; ++j){
      P c = intersection(lines[i],lines[j]);
      if(not in_poly(c,pol)) continue;
      cand.push_back(c);
    }
  }
  W rad = 0;
  for(auto p : cand){
    W t = 1e9;
    for(size_t i = 0; i < n; ++i){
      L l(pol[i],pol[(i+1)%n]);
      t = min(t,ps_dist(p,l));
    }
    rad = max(rad,t);
  }
  return rad;
}

W area(const Poly &p){
  int n = p.size();
  W ret = 0;
  for(int i = 0; i < n; ++i){
    ret += cross(p[i],p[(i+1)%n]);
  }
  return ret/2;
}

int main(){
  int w,h,n,r;
  while(cin >> w >> h >> n >> r, w){
    Poly init = {P(0,0),P(w,0),P(w,h),P(0,h)};
    vector<Poly> pols = {init};
    for(int i = 0; i < n; ++i){
      W x1, y1, x2, y2, t;
      cin >> x1 >> y1 >> x2 >> y2 >> t;
      P p1(x1,y1), p2(x2,y2), d = p2-p1, e = d/abs(d)*P(0,1);
      L ll(p1+t*e,p2+t*e), lr(p2-t*e,p1-t*e);
      vector<Poly> pols_;
      for(auto pol : pols){
        Poly pl = convex_cut(pol,ll), pr = convex_cut(pol,lr);
        if(not pl.empty()) pols_.push_back(pl);
        if(not pr.empty()) pols_.push_back(pr);
      }
      swap(pols,pols_);
    }
    W rad = 0;
    for(auto pol : pols){
      //debug(pol);
      if(area(pol) < r*r*pi) continue;
      rad = max(rad,max_radius(pol));
    }
    if(rad > r-EPS){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}



Measured memory_bytes: 3224