import java.io.*;
import java.util.*;

public class painting_bm_wa {
	FastScanner in;
	PrintWriter out;

	class Point {
		double x, y;

		public Point(double x, double y) {
			super();
			this.x = x;
			this.y = y;
		}
	}

	class Circle {
		Point p;
		double R;

		public Circle(Point p, double r) {
			super();
			this.p = p;
			R = r;
		}

	}

	class Line {
		double A, B, C;

		public Line(double a, double b, double c) {
			super();
			A = a;
			B = b;
			C = c;
		}

	}

	Point intersection(Circle c1, Line l) {
		double r = c1.R;
		double a = l.A;
		double b = l.B;
		double c = l.C;

		double x0 = -a * c / (a * a + b * b), y0 = -b * c / (a * a + b * b);
		double cc = c * c;
		double rr = r * r * (a * a + b * b);
		double tmp  = cc - rr;
		if (c * c > r * r * (a * a + b * b) + eps)
			return null;
		else if (Math.abs(c * c - r * r * (a * a + b * b)) < eps) {
			return new Point(x0, y0);
		} else {
			double d = r * r - c * c / (a * a + b * b);
			double mult = Math.sqrt(Math.max(0, d / (a * a + b * b)));
			double ax, ay;
			ax = x0 + b * mult;
			ay = y0 - a * mult;
			return new Point(ax, ay);
		}
	}

	Point intersection(Circle c1, Circle c2) {
		double A = -2. * (c2.p.x - c1.p.x);
		double B = -2. * (c2.p.y - c1.p.y);
		double x2 = c2.p.x - c1.p.x;
		double y2 = c2.p.y - c1.p.y;
		double r1 = c1.R;
		double r2 = c2.R;
		double C = (x2 * x2 + y2 * y2 + r1 * r1 - r2 * r2);
		Line l = new Line(A, B, C);
		Point pp = intersection(c1, l);
		if (pp == null)
			return null;
		pp.x += c1.p.x;
		pp.y += c1.p.y;
		return pp;
	}

	class Segment {
		double left, right;

		public Segment(double left, double right) {
			super();
			this.left = left;
			this.right = right;
		}

		@Override
		public String toString() {
			return "[" + left + ", " + right + "]";
		}

	}

	double dist(Point p1, Point p2) {
		double dx = p1.x - p2.x;
		double dy = p1.y - p2.y;
		return Math.sqrt(dx*dx+dy*dy);
	}

	double eps = 1e-3;

	void solve() {
		Point p1 = new Point(in.nextInt(), in.nextInt());
		Point p2 = new Point(in.nextInt(), in.nextInt());
		int n = in.nextInt();
		int[] len = new int[n];
		for (int i = 0; i < n; i++)
			len[i] = in.nextInt();
		Segment[] s = new Segment[n + 1];
		s[0] = new Segment(0, 0);
		for (int i = 1; i <= n; i++) {
			double l = Math.max(0,
					Math.max(s[i - 1].left - len[i - 1], 0)); 
			double r = s[i - 1].right + len[i - 1];
			s[i] = new Segment(l, r);
		}
		double dist = dist(p1, p2);
		if (s[n].left <= dist + eps && s[n].right >= dist - eps) {
			out.println("YES");
			ArrayList<Point> answ = new ArrayList<Point>();
			Point last = p2;
			for (int i = n - 1; i >= 0; i--) {
				answ.add(last);
				Circle cRight = new Circle(p1, s[i].right);
				Circle c2 = new Circle(last, len[i]);
				Point inter = intersection(cRight, c2);
				Point next = null;
				if (inter == null) {
					Circle cLeft = new Circle(p1, s[i].left);
					Point inter2 = intersection(cLeft, c2);
					if (inter2 == null) {
						double dx = -(last.x - p1.x);
						double dy = -(last.y - p1.y);
						double ss = Math.sqrt(dx*dx + dy*dy);
						next = new Point(last.x + len[i] * dx / ss, last.y + len[i] * dy / ss);
					} else {
						next = inter2;
					}
				} else {
					next = inter;
				}
				last = next;
			}
			answ.add(p1);
			Collections.reverse(answ);
			for (Point p : answ)
				out.println(p.x + " " + p.y);
		} else {
			out.println("NO");
		}
	}

	void run() {
		try {
			in = new FastScanner(new File("painting.in"));
			out = new PrintWriter(new File("painting.out"));

			solve();

			out.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	void runIO() {

		in = new FastScanner(System.in);
		out = new PrintWriter(System.out);

		solve();

		out.close();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}

	public static void main(String[] args) {
		new painting_bm_wa().run();
	}
}