#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
using namespace std;
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};

namespace std{
    bool operator < (const P& a, const P& b){
        return !EQ(a.X,b.X) ? a.X<b.X : a.Y+EPS<b.Y;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}

bool intersectSS(const L& a, const L& b){
    return ( ccw(a[0],a[1],b[0]) *ccw(a[0],a[1],b[1]) <= 0 ) &&
        ( ccw(b[0],b[1],a[0]) *ccw(b[0],b[1],a[1]) <= 0 );
}
bool intersectSP(const L& s, const P &p){
    return abs(cross(s[0]-p, s[1]-p))<EPS  && dot(s[0]-p, s[1]-p)<EPS;
}

bool isParallel(const P &a, const P &b){
    return abs(cross(a,b)) < EPS;
}
bool isParallel(const L &a, const L &b){
    return isParallel(a[1]-a[0], b[1]-b[0]);
}
P crosspointLL(const L &l, const L &m) {
  double A = cross(l[1]-l[0], m[1]-m[0]);
  double B = cross(l[1]-l[0], l[1]-m[0]);
  return m[0] + B/A *(m[1]-m[0]);
}

int in_poly(const P &p, const VP &poly){
    int n = poly.size();
    int ret = -1;
    for(int i=0; i<n; i++){
        P a = poly[i]-p;
        P b = poly[(i+1)%n]-p;
        if(a.Y > b.Y) swap(a,b);
        if(intersectSP(L(a,b), P(0,0))) return 0;
        if(a.Y<=0 && b.Y>0 && cross(a,b)<0) ret = -ret;
    }
    return ret;
}

int main(){
    while(1){
        int w,h,n;
        double r;
        cin >> w >> h >> n >> r;
        if(w == 0) break;

        VP sc{P(r, r), P(w-r, r), P(w-r, h-r), P(0, h-r)};
        vector<L> lines(2*n +4);
        for(int i=0; i<n; i++){
            double xs,ys,xt,yt, t;
            cin >> xs >> ys >> xt >> yt >> t;
            L line(P(xs, ys), P(xt, yt));
            P left = line[1] -line[0];
            left *= (r+t)/abs(left);
            left *= P(0, 1);
            lines[2*i] = L(line[0] +left, line[1] +left);
            lines[2*i +1] = L(line[1] -left, line[0] -left);
        }
        for(int i=0; i<4; i++){
            lines[2*n +i] = L(sc[i], sc[(i+1)%4]);
        }

        VP cand;
        for(int i=0; i<(int)lines.size(); i++){
            for(int j=i+1; j<(int)lines.size(); j++){
                if(!isParallel(lines[i], lines[j])){
                    cand.push_back(crosspointLL(lines[i], lines[j]));
                }
            }
        }

        bool yes = false;
        for(int i=0; i<(int)cand.size(); i++){
            bool allin = true;
            if(in_poly(cand[i], sc) == -1) continue;
            for(int j=0; j<n; j++){
                if(cross(lines[2*j][1] -lines[2*j][0], cand[i] -lines[2*j][0]) < -EPS &&
                    cross(lines[2*j+1][1] -lines[2*j+1][0], cand[i] -lines[2*j+1][0]) < -EPS){
                    allin = false;
                    break;
                }
            }
            if(allin){
                yes = true;
                break;
            }
        }
        if(yes){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }    
    return 0;
}



Measured memory_bytes: 3836