#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Ti = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

#define EPS (1e-8)
#define eq(a, b) (fabs((a)-(b)) < EPS)
#define lt(a, b) ((a) - (b) < -EPS)
#define le(a, b) (eq(a, b) || lt(a, b))

struct Point {
  double x, y;
  Point(double x = 0.0, double y = 0.0):x(x), y(y){}

  Point operator + (Point p) { return Point(x + p.x, y + p.y); }
  Point operator - (Point p) { return Point(x - p.x, y - p.y); }
  Point operator * (double a) { return Point(x * a, y * a); }
  Point operator / (double a) { return Point(x / a, y / a); }

  double abs() { return sqrt(norm()); }
  double norm() { return x*x + y*y; }

  bool operator < (const Point& p) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  bool operator == (const Point& p) const {
    return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
  }
};
typedef Point Vector;

double norm(Vector v) { return v.x*v.x + v.y*v.y; }
double abs(Vector v) { return sqrt(norm(v)); }
double dot(Vector a, Vector b) { return a.x*b.x + a.y*b.y; }
double cross(Vector a, Vector b) { return a.x*b.y - a.y*b.x; }

bool isOrthogonal(Vector a, Vector b) {
  return eq(dot(a, b), 0.0);
}
bool isOrthogonal(Point a1, Point a2, Point b1, Point b2) {
  return isOrthogonal(a1 - a2, b1 - b2);
}
bool isParallel(Vector a, Vector b) {
  return eq(cross(a, b), 0.0);
}
bool isParallel(Point a1, Point a2, Point b1, Point b2) {
  return isParallel(a1 - a2, b1 - b2);
}

#define COUNTER_CLOCKWISE +1
#define CLOCKWISE         -1
#define ONLINE_BACK       +2
#define ONLINE_FRONT      -2
#define ON_SEGMENT        +0
int ccw(Point p0, Point p1, Point p2) {
  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
  if(cross(a, b) < -EPS) return CLOCKWISE;
  if(dot(a, b) < -EPS) return ONLINE_BACK;
  if(a.norm() < b.norm()) return ONLINE_FRONT;
  return ON_SEGMENT;
}
bool intersect(Point p1, Point p2, Point p3, Point p4) {
  return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
	  ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}
double getDistance(Point a, Point b) { return abs(a - b); }

struct Segment {
  Point s, t;
  Segment(Point s = Point(), Point t = Point()):s(s), t(t){}
};
typedef Segment Line;

bool intersect(Segment s1, Segment s2) {
  return intersect(s1.s, s1.t, s2.s, s2.t);
}
bool isParallel(Line s1, Line s2) {
  return isParallel(s1.s, s1.t, s2.s, s2.t);
}
double getDistanceLP(Line l, Point p) {
  return abs(cross(l.t - l.s, p - l.s) / abs(l.t - l.s));
}
Point getCrossPointLL(Line l1, Line l2) {
  Vector v1 = l1.t - l1.s, v2 = l2.t - l2.s;
  double d = cross(v2, v1);
  if(abs(d) < EPS) return l2.s;
  return l1.s + v1 * cross(v2, l2.t - l1.s) * (1.0 / d);
}
vector<Vector> getNormalLineVector(Line l) {
  vector<Vector> vs;
  Vector v = l.t - l.s, p = v / abs(v);
  vs.emplace_back(-p.y, p.x);
  vs.emplace_back(p.y, -p.x);
  return vs;
}
vector<Line> getTranslation(Line l, double d) {
  vector<Vector> nlv = getNormalLineVector(l);
  vector<Line> nl;
  nl.emplace_back(l.s + nlv[0]*d, l.t + nlv[0]*d);
  nl.emplace_back(l.s + nlv[1]*d, l.t + nlv[1]*d);
  return nl;
}

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int W, H, N, R;
  while(cin >> W >> H >> N >> R, W) {
    vector<Line> beam;
    vector<double> thick;
    beam.push_back(Line(Point(0, 0), Point(W, 0)));
    thick.push_back(0);
    beam.push_back(Line(Point(0, 0), Point(0, H)));
    thick.push_back(0);
    beam.push_back(Line(Point(W, H), Point(W, 0)));
    thick.push_back(0);
    beam.push_back(Line(Point(W, H), Point(0, H)));
    thick.push_back(0);
    vector<Line> war;
    war.push_back(Line(Point(R, R), Point(W-R, R)));
    war.push_back(Line(Point(R, R), Point(R, H-R)));
    war.push_back(Line(Point(W-R, H-R), Point(W-R, R)));
    war.push_back(Line(Point(W-R, H-R), Point(R, H-R)));
    rep(i, N) {
      Point p, q;
      double t;
      cin >> p.x >> p.y >> q.x >> q.y >> t;
      beam.push_back(Line(p, q));
      thick.push_back(t);
      auto L = getTranslation(beam.back(), t+R);
      for(auto&& l : L) war.push_back(l);//, cout<<l.s.x<<","<<l.s.y<<" "<<l.t.x<<","<<l.t.y<<endl;
    }
    auto in = [&](Point p) {
      //return 0<=p.x&&p.x<=W&&0<=p.y&&p.y<=H;
      return le(0,p.x)&&le(p.x,W)&&le(0,p.y)&&le(p.y,H);
    };
    auto check = [&](Point p) {
      if(!in(p)) return false;
      rep(i, beam.size()) {
	double d = getDistanceLP(beam[i], p) - thick[i];
	if(lt(d, R)) return false;
      }
      return true;
    };
    bool flag = false;
    for(auto&& l1 : war) {
      for(auto&& l2 : war) {
	if(isParallel(l1, l2)) continue;
	Point p = getCrossPointLL(l1, l2);
	if(check(p)) {
	  //cout << p.x<<" "<<p.y<<endl;
	  flag = true;
	  break;
	}
      }
      if(flag) break;
    }
    cout << (flag ? "Yes" : "No") << endl;
  }

  return 0;
}

Measured memory_bytes: 3212