// Arup Guha
// 2/3/2018
// Solution to 2017 MCPC Problem E: Honey Heist

import java.util.*;

public class honey {

	public static int[] DX = {-1,-1,0,0,1,1};
	public static int[] DY = {-1,0,-1,1,0,1};
	public static int[][] grid;
	public static int r;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		r = stdin.nextInt();
		int maxD = stdin.nextInt();
		int start = stdin.nextInt();
		int end = stdin.nextInt();
		int nBad = stdin.nextInt();

		// Store who is bad.
		boolean[] bad = new boolean[10000];
		for (int i=0; i<nBad; i++)
			bad[stdin.nextInt()] = true;

		// -1 means you can't go there.
		grid = new int[2*r-1][2*r-1];
		for (int i=0; i<2*r-1; i++) Arrays.fill(grid[i], -1);

		// i is my row number - numbers for top half of grid.
		int ID = 1;
		for (int i=0; i<r; i++)
			for (int j=0; j<r+i; j++, ID++)
				grid[i][j] = ID;

		// i is the starting column number for each row now.
		for (int i=1; i<r; i++)
			for (int j=i; j<2*r-1; j++, ID++)
				grid[r+i-1][j] = ID;

		// Set up BFS.
		int startLoc = getRC(start);
		int endLoc = getRC(end);
		LinkedList<Integer> q = new LinkedList<Integer>();
		q.offer(startLoc);

		int[][] dist = new int[2*r-1][2*r-1];
		for (int i=0; i<2*r-1; i++) Arrays.fill(dist[i], -1);
		dist[startLoc/(2*r)][startLoc%(2*r)] = 0;

		while (q.size() > 0) {

			// Get next.
			int cur = q.poll();
			int cX = cur/(2*r);
			int cY = cur%(2*r);

			// Go to neighbors.
			for (int i=0; i<DX.length; i++) {

				int nX = cX + DX[i];
				int nY = cY + DY[i];

				// Means the square is invalid for some reason.
				if (!inbounds(nX, nY) || grid[nX][nY] == -1 || bad[grid[nX][nY]]) continue;

				// Means we've been here before.
				if (dist[nX][nY] != -1) continue;

				// Mark distance and add to queue.
				dist[nX][nY] = dist[cX][cY] + 1;
				q.offer(nX*2*r + nY);
			}
		}

		// See if we made it to the end...
		int eX = endLoc/(2*r);
		int eY = endLoc%(2*r);
		if (dist[eX][eY] == -1 || dist[eX][eY] > maxD)
			System.out.println("No");
		else
			System.out.println(dist[eX][eY]);
	}

	// Returns spot (i, j) with num 2*r*i+j;
	public static int getRC(int num) {
		for (int i=0; i<2*r-1; i++)
			for (int j=0; j<2*r-1; j++)
				if (grid[i][j] == num)
					return i*2*r + j;

		return -1;
	}

	public static boolean inbounds(int x, int y) {
		return x >= 0 && x < 2*r-1 && y >= 0 && y < 2*r-1;
	}
}