#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;

const double DELTA = 1e-5;

/* typedef */

template <typename T>
struct Pt {
  T x, y;

  Pt() {}
  Pt(T _x, T _y) : x(_x), y(_y) {}
  Pt(const Pt& pt) : x(pt.x), y(pt.y) {}

  bool operator==(const Pt pt) const { return x == pt.x && y == pt.y; }
  Pt<T> operator+(const Pt pt) const { return Pt<T>(x + pt.x, y + pt.y); }
  Pt<T> operator-() const { return Pt<T>(-x, -y); }
  Pt<T> operator-(const Pt pt) const { return Pt<T>(x - pt.x, y - pt.y); }
  Pt<T> operator*(T t) const { return Pt<T>(x * t, y * t); }
  Pt<T> operator/(T t) const { return Pt<T>(x / t, y / t); }
  T dot(Pt v) const { return x * v.x + y * v.y; }
  T cross(Pt v) const { return x * v.y - y * v.x; }
  Pt<T> mid(const Pt pt) { return Pt<T>((x + pt.x) / 2, (y + pt.y) / 2); }
  T d2() { return x * x + y * y; }
  double d() { return sqrt(d2()); }

  Pt<T> rot(double th) {
    double c = cos(th), s = sin(th);
    return Pt<T>(c * x - s * y, s * x + c * y);
  }

  Pt<T> rot90() { return Pt<T>(-y, x); }

  bool operator<(const Pt& pt) const {
    return x < pt.x || (x == pt.x && y < pt.y);
  }

  void print(string format) {
    printf(("(" + format + ", " + format + ")\n").c_str(), x, y);
  }
  void print() { print("%.6lf"); }
};

typedef Pt<double> pt;
typedef vector<pt> vpt;
typedef vector<vpt> vvpt;

struct CL {
  pt p;
  double t0, t1;
  CL() {}
  CL(const pt& _p, double _t0, double _t1) : p(_p), t0(_t0), t1(_t1) {}
};

struct Laser {
  pt p0, p1;
  double t;
};

/* global variables */

int w, h, n, r;
Laser lsrs[MAX_N];

vvpt cps[2];

/* subroutines */

bool cross_lines(const pt& a0, const pt& da, const pt& b0, const pt& db,
                 CL& cl) {
  double op01 = da.cross(db);
  if (op01 == 0.0) return false; /* need to handle parallel?? */

  pt v = b0 - a0;
  double op0 = v.cross(da);
  double op1 = v.cross(db);

  double t0 = op1 / op01;
  double t1 = op0 / op01;

  cl.p = db * t1 + b0;
  cl.t0 = t0;
  cl.t1 = t1;
  return true;
}

void convex_cut(const vpt& scpol, vpt& dcpol, const pt& p0, const pt& v) {
  int nn = scpol.size();
  dcpol.clear();

  for (int i = 0; i < nn; i++) {
    pt cpt0 = scpol[i];
    double cr0 = v.cross(cpt0 - p0);
    if (cr0 >= 0.0) dcpol.push_back(cpt0);
    
    pt cpt1 = scpol[(i + 1) % nn];
    double cr1 = v.cross(cpt1 - p0);
    if (cr0 * cr1 < 0.0) {
      CL cl;
      cross_lines(p0, v, cpt0, cpt1 - cpt0, cl);
      dcpol.push_back(cl.p);
    }
  }
}

/* main */

int main() {
  for (;;) {
    cin >> w >> h >> n >> r;
    if (n == 0) break;
    //printf("w=%d,h=%d,n=%d,r=%d\n", w, h, n, r);
    
    for (int i = 0; i < n; i++) {
      Laser& li = lsrs[i];
      cin >> li.p0.x >> li.p0.y >> li.p1.x >> li.p1.y >> li.t;
    }

    vpt scr;
    scr.push_back(pt(r, r));
    scr.push_back(pt(w - r, r));
    scr.push_back(pt(w - r, h - r));
    scr.push_back(pt(r, h - r));

    cps[0].clear();
    cps[0].push_back(scr);

    int cur = 0, nxt = 1;

    for (int i = 0; i < n; i++) {
      Laser& li = lsrs[i];

      pt v = li.p1 - li.p0;
      pt d = v.rot90() / v.d() * (li.t + r + DELTA);

      pt p0 = li.p0 + d, v0 = v;
      pt p1 = li.p0 - d, v1 = -v;
      
      cps[nxt].clear();

      for (vvpt::iterator vvit = cps[cur].begin();
	   vvit != cps[cur].end(); vvit++) {
	vpt cpol;
	convex_cut(*vvit, cpol, p0, v0);
	if (cpol.size() >= 3) cps[nxt].push_back(cpol);
	convex_cut(*vvit, cpol, p1, v1);
	if (cpol.size() >= 3) cps[nxt].push_back(cpol);
      }

      cur ^= 1;
      nxt ^= 1;
    }

    if (false) {
      vvpt& cpc = cps[cur];
      printf("%lu\n", cpc.size());
      for (int i = 0; i < cpc.size(); i++) {
	for (int j = 0; j < cpc[i].size(); j++)
	  printf("(%lf,%lf)", cpc[i][j].x, cpc[i][j].y);
	putchar('\n');
      }
    }
      
    cout << (cps[cur].size() > 0 ? "Yes" : "No") << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1236