import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Stream;

/**
 * @author madi.sagimbekov
 */
public class C1341B {

    private static BufferedReader in;
    private static BufferedWriter out;

    private static List<Integer>[] list;
    private static int[] arr;
    private static int[][] dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    private static boolean[] used;

    public static void main(String[] args) throws IOException {
        open();

        int t = readInt();
        while (t-- > 0) {
            int[] nk = readInts();
            int n = nk[0];
            int k = nk[1];
            int[] a = readInts();

            TreeSet<Integer> peaks = new TreeSet<>();
            HashMap<Integer, Integer> map = new HashMap<>();
            int index = 0;
            for (int i = 1; i < n - 1; i++) {
                if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                    peaks.add(i);
                    map.put(i, index++);
                }
            }

            int max = 1;
            int ind = 1;

            for (int i = 0; i < n; i++) {
                int left = i;
                int right = i + k - 1;
                if (right < n) {
                    Integer low = peaks.higher(left);
                    Integer up = peaks.lower(right);
                    if (low != null && up != null) {
                        if (max < map.get(up) - map.get(low) + 2) {
                            max = map.get(up) - map.get(low) + 2;
                            ind = i + 1;
                        }
                    }
                }
            }

            out.write(max + " " + ind + "\n");
        }

        close();
    }

    private static int[] readInts() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static int readInt() throws IOException {
        return Integer.parseInt(in.readLine());
    }

    private static long[] readLongs() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
    }

    private static long readLong() throws IOException {
        return Long.parseLong(in.readLine());
    }

    private static double[] readDoubles() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
    }

    private static double readDouble() throws IOException {
        return Double.parseDouble(in.readLine());
    }

    private static String readString() throws IOException {
        return in.readLine();
    }

    private static List<Integer>[] buildAdjacencyList(int n, int m) throws IOException {
        List<Integer>[] list = new ArrayList[n + 1];
        for (int i = 0; i <= n; i++) {
            list[i] = new ArrayList<>();
        }

        for (int i = 0; i < m; i++) {
            int[] e = readInts();
            list[e[0]].add(e[1]);
            list[e[1]].add(e[0]);
        }

        return list;
    }

    private static void open() {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new BufferedWriter(new OutputStreamWriter((System.out)));
    }

    private static void close() throws IOException {
        out.flush();
        out.close();
        in.close();
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author madi.sagimbekov
 */
public class C1341B {

    private static BufferedReader in;
    private static BufferedWriter out;

    private static List<Integer>[] list;
    private static int[] arr;
    private static int[][] dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    private static boolean[] used;

    public static void main(String[] args) throws IOException {
        open();

        int t = readInt();
        while (t-- > 0) {
            int[] nk = readInts();
            int n = nk[0];
            int k = nk[1];
            int[] a = readInts();

            List<Integer> peaks = new ArrayList<>();
            for (int i = 1; i < n - 1; i++) {
                if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                    peaks.add(i);
                }
            }

            int i = 0;
            int j = 0;
            int max = 0;
            int ind = 0;

            while (j < peaks.size()) {
                int left = peaks.get(i);
                int right = peaks.get(j);
                if (right - left + 3 <= k) {
                    if (max < j - i + 2) {
                        max = j - i + 2;
                        ind = Math.max(right - k + 3, 1);
                    }
                    j++;
                } else {
                    i++;
                }
            }

            out.write(max + " " + ind + "\n");
        }

        close();
    }

    private static int[] readInts() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static int readInt() throws IOException {
        return Integer.parseInt(in.readLine());
    }

    private static long[] readLongs() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
    }

    private static long readLong() throws IOException {
        return Long.parseLong(in.readLine());
    }

    private static double[] readDoubles() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
    }

    private static double readDouble() throws IOException {
        return Double.parseDouble(in.readLine());
    }

    private static String readString() throws IOException {
        return in.readLine();
    }

    private static List<Integer>[] buildAdjacencyList(int n, int m) throws IOException {
        List<Integer>[] list = new ArrayList[n + 1];
        for (int i = 0; i <= n; i++) {
            list[i] = new ArrayList<>();
        }

        for (int i = 0; i < m; i++) {
            int[] e = readInts();
            list[e[0]].add(e[1]);
            list[e[1]].add(e[0]);
        }

        return list;
    }

    private static void open() {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new BufferedWriter(new OutputStreamWriter((System.out)));
    }

    private static void close() throws IOException {
        out.flush();
        out.close();
        in.close();
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Stream;

/**
 * @author madi.sagimbekov
 */
public class C1341B {

    private static BufferedReader in;
    private static BufferedWriter out;

    private static List<Integer>[] list;
    private static int[] arr;
    private static int[][] dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    private static boolean[] used;

    public static void main(String[] args) throws IOException {
        open();

        int t = readInt();
        while (t-- > 0) {
            int[] nk = readInts();
            int n = nk[0];
            int k = nk[1];
            int[] a = readInts();

            TreeSet<Integer> peaks = new TreeSet<>();
            HashMap<Integer, Integer> map = new HashMap<>();
            int index = 0;
            for (int i = 1; i < n - 1; i++) {
                if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                    peaks.add(i);
                    map.put(i, index++);
                }
            }

            int max = 0;
            int ind = 0;

            for (int i = 0; i < n; i++) {
                int left = i;
                int right = i + k - 1;
                Integer low = peaks.higher(left);
                Integer up = peaks.lower(right);
                if (low != null && up != null) {
                    if (max < map.get(up) - map.get(low) + 2) {
                        max = map.get(up) - map.get(low) + 2;
                        ind = i + 1;
                    }
                }
            }

            out.write(max + " " + ind + "\n");
        }

        close();
    }

    private static int[] readInts() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static int readInt() throws IOException {
        return Integer.parseInt(in.readLine());
    }

    private static long[] readLongs() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
    }

    private static long readLong() throws IOException {
        return Long.parseLong(in.readLine());
    }

    private static double[] readDoubles() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
    }

    private static double readDouble() throws IOException {
        return Double.parseDouble(in.readLine());
    }

    private static String readString() throws IOException {
        return in.readLine();
    }

    private static List<Integer>[] buildAdjacencyList(int n, int m) throws IOException {
        List<Integer>[] list = new ArrayList[n + 1];
        for (int i = 0; i <= n; i++) {
            list[i] = new ArrayList<>();
        }

        for (int i = 0; i < m; i++) {
            int[] e = readInts();
            list[e[0]].add(e[1]);
            list[e[1]].add(e[0]);
        }

        return list;
    }

    private static void open() {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new BufferedWriter(new OutputStreamWriter((System.out)));
    }

    private static void close() throws IOException {
        out.flush();
        out.close();
        in.close();
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Stream;

/**
 * @author madi.sagimbekov
 */
public class C1341B {

    private static BufferedReader in;
    private static BufferedWriter out;

    private static List<Integer>[] list;
    private static int[] arr;
    private static int[][] dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    private static boolean[] used;

    public static void main(String[] args) throws IOException {
        open();

        int t = readInt();
        while (t-- > 0) {
            int[] nk = readInts();
            int n = nk[0];
            int k = nk[1];
            int[] a = readInts();

            TreeSet<Integer> peaks = new TreeSet<>();
            HashMap<Integer, Integer> map = new HashMap<>();
            int index = 0;
            for (int i = 1; i < n - 1; i++) {
                if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                    peaks.add(i);
                    map.put(i, index++);
                }
            }

            int max = 0;
            int ind = 0;

            for (int i = 0; i < n; i++) {
                int left = i;
                int right = i + k - 1;
                if (right < n) {
                    Integer low = peaks.higher(left);
                    Integer up = peaks.lower(right);
                    if (low != null && up != null) {
                        if (max < map.get(up) - map.get(low) + 2) {
                            max = map.get(up) - map.get(low) + 2;
                            ind = i + 1;
                        }
                    }
                }
            }

            out.write(max + " " + ind + "\n");
        }

        close();
    }

    private static int[] readInts() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static int readInt() throws IOException {
        return Integer.parseInt(in.readLine());
    }

    private static long[] readLongs() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
    }

    private static long readLong() throws IOException {
        return Long.parseLong(in.readLine());
    }

    private static double[] readDoubles() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
    }

    private static double readDouble() throws IOException {
        return Double.parseDouble(in.readLine());
    }

    private static String readString() throws IOException {
        return in.readLine();
    }

    private static List<Integer>[] buildAdjacencyList(int n, int m) throws IOException {
        List<Integer>[] list = new ArrayList[n + 1];
        for (int i = 0; i <= n; i++) {
            list[i] = new ArrayList<>();
        }

        for (int i = 0; i < m; i++) {
            int[] e = readInts();
            list[e[0]].add(e[1]);
            list[e[1]].add(e[0]);
        }

        return list;
    }

    private static void open() {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new BufferedWriter(new OutputStreamWriter((System.out)));
    }

    private static void close() throws IOException {
        out.flush();
        out.close();
        in.close();
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        long startTime = System.nanoTime();
        int t = in.nextInt();
        while (t-- > 0) {
            solve();
        }
        long endTime = System.nanoTime();
        err.println("Execution Time : +" + (endTime - startTime) / 1000000 + " ms");
        exit(0);
    }

    static void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = in.readAllInts(n);
        int[] peaks_so_far = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            if (i > 0 && a[i - 1] < a[i] && i + 1 < n && a[i] > a[i + 1]) {
                c++;
                peaks_so_far[i + 1] = c;
            } else if (i + 1 < n) {
                peaks_so_far[i + 1] = c;
            }
        }
        int maxpeak = 0;
        int minIndex = 0;
        for (int i = 0; i + k - 1 < n; i++) {
            int peak = peaks_so_far[i + k - 1] - peaks_so_far[i];
            if (peak > maxpeak) {
                maxpeak = peak;
                minIndex = i;
            }
        }
        out.println((maxpeak + 1) + " " + (minIndex + 1));
    }

    static void debug(Object... args) {
        for (Object a : args) {
            out.println(a);
        }
    }

    static void y() {
        out.println("YES");
    }

    static void n() {
        out.println("NO");
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public int[] readAllInts(int n) {
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public int[] readAllInts(int n, int s) {
            int[] p = new int[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n) {
            long[] p = new long[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n, int s) {
            long[] p = new long[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static void exit(int a) {
        out.close();
        err.close();
        System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        long startTime = System.nanoTime();
        int t = in.nextInt();
        while (t-- > 0) {
            solve();
        }
        long endTime = System.nanoTime();
        err.println("Execution Time : +" + (endTime - startTime) / 1000000 + " ms");
        exit(0);
    }

    static void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = in.readAllInts(n);
        int[] peaks_so_far = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            if (i > 0 && a[i - 1] < a[i] && i + 1 < n && a[i] > a[i + 1]) {
                c++;
                peaks_so_far[i + 1] = c;
            } else if (i + 1 < n) {
                peaks_so_far[i + 1] = c;
            }
        }
        int maxpeak = 0;
        int minIndex = n;
        for (int i = 0; i + k - 1 < n; i++) {
            int peak = peaks_so_far[i + k - 1] - peaks_so_far[i];
            if (peak > maxpeak) {
                maxpeak = peak;
                minIndex = i;
            }
        }
        out.println((maxpeak + 1) + " " + (minIndex + 1));
    }

    static void debug(Object... args) {
        for (Object a : args) {
            out.println(a);
        }
    }

    static void y() {
        out.println("YES");
    }

    static void n() {
        out.println("NO");
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public int[] readAllInts(int n) {
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public int[] readAllInts(int n, int s) {
            int[] p = new int[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n) {
            long[] p = new long[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n, int s) {
            long[] p = new long[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static void exit(int a) {
        out.close();
        err.close();
        System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        long startTime = System.nanoTime();
        int t = in.nextInt();
        while (t-- > 0) {
            solve();
        }
        long endTime = System.nanoTime();
        err.println("Execution Time : +" + (endTime - startTime) / 1000000 + " ms");
        exit(0);
    }

    static void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = in.readAllInts(n);
        int[] peaks_so_far = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            if (i > 0 && a[i - 1] < a[i] && i + 1 < n && a[i] > a[i + 1]) {
                c++;
                peaks_so_far[i + 1] = c;
            } else if (i + 1 < n) {
                peaks_so_far[i + 1] = c;
            }
        }
        peaks_so_far[n - 1] = c;
        int maxpeak = 0;
        int minIndex = 0;
        for (int i = 0; i + k - 1 < n; i++) {
            int peak = peaks_so_far[i + k - 1] - peaks_so_far[i];
            if (peak > maxpeak) {
                maxpeak = peak;
                minIndex = i;
            }
        }
        out.println((maxpeak + 1) + " " + (minIndex + 1));
    }

    static void debug(Object... args) {
        for (Object a : args) {
            out.println(a);
        }
    }

    static void y() {
        out.println("YES");
    }

    static void n() {
        out.println("NO");
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public int[] readAllInts(int n) {
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public int[] readAllInts(int n, int s) {
            int[] p = new int[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n) {
            long[] p = new long[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n, int s) {
            long[] p = new long[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static void exit(int a) {
        out.close();
        err.close();
        System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        long startTime = System.nanoTime();
        int t = in.nextInt();
        while (t-- > 0) {
            solve();
        }
        long endTime = System.nanoTime();
        err.println("Execution Time : +" + (endTime - startTime) / 1000000 + " ms");
        exit(0);
    }

    static void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = in.readAllInts(n);
        int[] peaks_so_far = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            if (i > 0 && a[i - 1] < a[i] && i + 1 < n && a[i] > a[i + 1]) {
                c++;
                peaks_so_far[i + 1] = c;
            } else if (i + 1 < n) {
                peaks_so_far[i + 1] = c;
            }
        }
        int maxpeak = 0;
        int minIndex = 0;
        for (int i = 0; i + k - 1 < n; i++) {
            int peak = peaks_so_far[i + k - 1] - peaks_so_far[i];
            if (peak > maxpeak) {
                maxpeak = peak;
                minIndex = i;
            }
        }
        if (maxpeak == 0) {
            maxpeak = -1;
        }
        out.println((maxpeak + 1) + " " + (minIndex + 1));
    }

    static void debug(Object... args) {
        for (Object a : args) {
            out.println(a);
        }
    }

    static void y() {
        out.println("YES");
    }

    static void n() {
        out.println("NO");
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public int[] readAllInts(int n) {
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public int[] readAllInts(int n, int s) {
            int[] p = new int[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n) {
            long[] p = new long[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n, int s) {
            long[] p = new long[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static void exit(int a) {
        out.close();
        err.close();
        System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        long startTime = System.nanoTime();
        int t = in.nextInt();
        while (t-- > 0) {
            solve();
        }
        long endTime = System.nanoTime();
        err.println("Execution Time : +" + (endTime - startTime) / 1000000 + " ms");
        exit(0);
    }

    static void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = in.readAllInts(n);
        int[] peaks_so_far = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            if (i > 0 && a[i - 1] < a[i] && i + 1 < n && a[i] > a[i + 1]) {
                peaks_so_far[i] = 1;
            }
        }
        for (int i = 1; i < n; i++) {
            peaks_so_far[i] = peaks_so_far[i] + peaks_so_far[i - 1];
        }
        int maxpeak = 0;
        int minIndex = 0;
        for (int i = 0; i + k - 2 < n; i++) {
            int peak = peaks_so_far[i + k - 2] - peaks_so_far[i];
            if (peak > maxpeak) {
                maxpeak = peak;
                minIndex = i;
            }
        }
        out.println((maxpeak + 1) + " " + (minIndex + 1));
    }

    static void debug(Object... args) {
        for (Object a : args) {
            out.println(a);
        }
    }

    static void y() {
        out.println("YES");
    }

    static void n() {
        out.println("NO");
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public int[] readAllInts(int n) {
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public int[] readAllInts(int n, int s) {
            int[] p = new int[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n) {
            long[] p = new long[n];
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public long[] readAllLongs(int n, int s) {
            long[] p = new long[n + s];
            for (int i = s; i < n + s; i++) {
                p[i] = in.nextInt();
            }
            return p;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static void exit(int a) {
        out.close();
        err.close();
        System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class codeforces637div2 {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

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

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String[] args) {
    FastReader s=new FastReader();
    int a=s.nextInt();
    for(int i=0;i<a;i++){
        int b=s.nextInt();
        int c=s.nextInt();
        int arr[]=new int[b];
        for(int j=0;j<b;j++)
            arr[j]=s.nextInt();
        int arr1[]=new int[b];
        for(int j=1;j<b-1;j++)
            if(arr[j]>arr[j-1]&&arr[j]>arr[j+1])
                arr1[j]=arr1[j-1]+1;
            else
                arr1[j]=arr1[j-1];
            arr1[arr.length-1]=arr1[arr.length-2];
//            arr[0]=0;
            int maxans=0;
//            for(int j=0;j<b;j++)
//                System.out.print(arr1[j]+" ");
            int var=-1,var1=-1,var2=-1;
            for(int j=1;j<=b-c+1;j++){
                if(arr1[j]>arr1[j-1])
                    var=arr1[j-1];
                else {
                    if(arr1[j-1]==0)
                        var=0;
                    else
                    var = Math.max(arr1[j - 1] + 1, 0);
                }if(arr1[j+c-2]==arr1[j+c-3])
                    var1=arr1[j+c-2];
                else
                    var1=Math.max(arr1[j+c-2]-1,0);
                int ans=(var1-var);
//                System.out.println(ans+" "+j);
                if(ans>maxans) {
                 maxans=ans;
                    var2 = j;
                }
            }
        System.out.println((maxans+1)+" "+var2);
//        int b1=s.nextInt();
//        int b2=s.nextInt();
//        int b3=s.nextInt();
//        int b4=s.nextInt();

//        int c=s.nextInt();
////        StringBuilder sb=new StringBuilder();
//        int arr[]=new int[4];
//        for(int j=0;j<4;j++)
//            arr[j]=s.nextInt();
//        int ans= b*(b1-b2);
//        int minans= b*(b1+b2);
//        if((minans<b3-b4)||(ans>b3+b4))
//            System.out.println("no");
//        else
//            System.out.println("yes");
    }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class codeforces637div2 {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

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

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String[] args) {
    FastReader s=new FastReader();
    int a=s.nextInt();
    for(int i=0;i<a;i++){
        int b=s.nextInt();
        int c=s.nextInt();
        int arr[]=new int[b];
        for(int j=0;j<b;j++)
            arr[j]=s.nextInt();
        int arr1[]=new int[b];
        for(int j=1;j<b-1;j++)
            if(arr[j]>arr[j-1]&&arr[j]>arr[j+1])
                arr1[j]=arr1[j-1]+1;
            else
                arr1[j]=arr1[j-1];
            arr1[arr.length-1]=arr1[arr.length-2];
//            arr[0]=0;
            int maxans=0;
//            for(int j=0;j<b;j++)
//                System.out.print(arr1[j]+" ");
            int var=0,var1=0,var2=1;
            for(int j=1;j<=b-c+1;j++){
                if(arr1[j]>arr1[j-1])
                    var=arr1[j-1];
                else {
                    if(arr1[j-1]==0)
                        var=0;
                    else
                    var = Math.max(arr1[j - 1] , 0);
                }if(arr1[j+c-2]==arr1[j+c-3])
                    var1=arr1[j+c-2];
                else
                    var1=Math.max(arr1[j+c-2]-1,0);
                int ans=(var1-var);
//                System.out.println(ans+" "+j);
                if(ans>maxans) {
                 maxans=ans;
                    var2 = j;
                }
            }
//            if(var2==-1)
//                var2=1;
        System.out.println((maxans+1)+" "+var2);
//        int b1=s.nextInt();
//        int b2=s.nextInt();
//        int b3=s.nextInt();
//        int b4=s.nextInt();

//        int c=s.nextInt();
////        StringBuilder sb=new StringBuilder();
//        int arr[]=new int[4];
//        for(int j=0;j<4;j++)
//            arr[j]=s.nextInt();
//        int ans= b*(b1-b2);
//        int minans= b*(b1+b2);
//        if((minans<b3-b4)||(ans>b3+b4))
//            System.out.println("no");
//        else
//            System.out.println("yes");
    }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class codeforces637div2 {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

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

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String[] args) {
    FastReader s=new FastReader();
    int a=s.nextInt();
    for(int i=0;i<a;i++){
        int b=s.nextInt();
        int c=s.nextInt();
        int arr[]=new int[b];
        for(int j=0;j<b;j++)
            arr[j]=s.nextInt();
        int arr1[]=new int[b];
        for(int j=1;j<b-1;j++)
            if(arr[j]>arr[j-1]&&arr[j]>arr[j+1])
                arr1[j]=arr1[j-1]+1;
            else
                arr1[j]=arr1[j-1];
            arr1[arr.length-1]=arr1[arr.length-2];
//            arr[0]=0;
            int maxans=0;
//            for(int j=0;j<b;j++)
//                System.out.print(arr1[j]+" ");
            int var=-1,var1=-1,var2=-1;
            for(int j=1;j<=b-c+1;j++){
                if(arr1[j]>arr1[j-1])
                    var=arr1[j-1];
                else {
                    if(arr1[j-1]==0)
                        var=0;
                    else
                    var = Math.max(arr1[j - 1] + 1, 0);
                }if(arr1[j+c-2]==arr1[j+c-3])
                    var1=arr1[j+c-2];
                else
                    var1=Math.max(arr1[j+c-2]-1,0);
                int ans=(var1-var);
//                System.out.println(ans+" "+j);
                if(ans>maxans) {
                 maxans=ans;
                    var2 = j;
                }
            }
            if(var2==-1)
                var2=1;
        System.out.println((maxans+1)+" "+var2);
//        int b1=s.nextInt();
//        int b2=s.nextInt();
//        int b3=s.nextInt();
//        int b4=s.nextInt();

//        int c=s.nextInt();
////        StringBuilder sb=new StringBuilder();
//        int arr[]=new int[4];
//        for(int j=0;j<4;j++)
//            arr[j]=s.nextInt();
//        int ans= b*(b1-b2);
//        int minans= b*(b1+b2);
//        if((minans<b3-b4)||(ans>b3+b4))
//            System.out.println("no");
//        else
//            System.out.println("yes");
    }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {

	private static void findAns(int n, int k ,int [] a)
	{

		int maxPeaks = 0;

		int tempIndex =-1;
		int [] b =new int [n];
		Arrays.fill(b, 0);
		int peaks =0;

		for(int j =1;j<a.length-1;j++)
		{

			if(a[j]>a[j-1] && a[j]>a[j+1])
			{
			peaks++;
			}
			b[j] =peaks;

		}
		b[n-1] =peaks;

		for(int i =0 ;i<b.length-k+1;i++)
		{
		int tempPeaks =0;
		tempPeaks = b[i+k-2] - b[i];
		if(tempPeaks>maxPeaks)
		{
			tempIndex =i;
			maxPeaks =tempPeaks;
		}

		}

		if(tempIndex!=-1)
		{
		System.out.println((maxPeaks+1)+" "+(tempIndex+1));
		}
		else {
			System.out.println(1+" "+1);
		}

	}

	public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);

		int t= in.nextInt();

		for(int i =0;i<t;i++)
		{
			int n = in.nextInt();
			int k =in.nextInt();
			int [] a = new int [n];

			for(int j=0;j<n;j++)
			{
				a[j] =in.nextInt();
			}

			findAns(n,k,a);

		}

	}

}


import java.util.Scanner;

public class Demo01 {

	private static void findAns(int n, int k ,int [] a)
	{

		int maxPeaks = 0;
		int tempPeaks =0;
		int tempIndex =-1;

		for(int i =0;i<a.length-k+1;i++)
		{
			tempPeaks =0;

			for(int j =i+1;j<i+k-1;j++)
			{
				if(a[j]>a[j-1] && a[j]>a[j+1])
				{
					tempPeaks++;
				}

			}

			if(tempPeaks>maxPeaks)
			{
				maxPeaks =tempPeaks;
				tempIndex= i;
			}

		}

		if(tempIndex!=-1)
		{
		System.out.println((maxPeaks+1)+" "+(tempIndex+1));
		}
		else {
			System.out.println(1+" "+1);
		}

	}

	public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);

		int t= in.nextInt();

		for(int i =0;i<t;i++)
		{
			int n = in.nextInt();
			int k =in.nextInt();
			int [] a = new int [n];

			for(int j=0;j<n;j++)
			{
				a[j] =in.nextInt();
			}

			findAns(n,k,a);

		}

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {

	private static void findAns(int n, int k ,int [] a)
	{

		int maxPeaks = 0;
		int tempPeaks =0;
		int tempIndex =-1;
		int [] b = new int [n];
		Arrays.fill(b,0);
		for(int i=1;i<a.length-1;i++)
		{
			if(a[i]>a[i-1] && a[i]>a[i+1])
			{
				b[i] =1;
			}

		}

		for(int i =0;i<b.length-k+1;i++)
		{
			tempPeaks =0;
			for(int j =i+1;j<i+k-1;j++)
			{
				if(b[j]==1)
				{
					tempPeaks++;
				}

			}

			if(tempPeaks>maxPeaks)
			{
				maxPeaks =tempPeaks;
				tempIndex= i;
			}

		}

		System.out.println((maxPeaks+1)+" "+(tempIndex+1));

	}

	public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);

		int t= in.nextInt();

		for(int i =0;i<t;i++)
		{
			int n = in.nextInt();
			int k =in.nextInt();
			int [] a = new int [n];

			for(int j=0;j<n;j++)
			{
				a[j] =in.nextInt();
			}

			findAns(n,k,a);

		}

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {

	private static void findAns(int n, int k ,int [] a)
	{

		int maxPeaks = 0;
		int tempPeaks =0;
		int tempIndex =-1;
		int [] b = new int [n];
		Arrays.fill(b,0);
		for(int i=1;i<a.length-1;i++)
		{
			if(a[i]>a[i-1] && a[i]>a[i+1])
			{
				b[i] =1;
			}

		}

		for(int i =0;i<b.length-k+1;i++)
		{
			tempPeaks =0;
			for(int j =i+1;j<i+k-1;j++)
			{
				if(b[j]==1)
				{
					tempPeaks++;
				}

			}

			if(tempPeaks>maxPeaks)
			{
				maxPeaks =tempPeaks;
				tempIndex= i;
			}

		}

		if(tempIndex!=-1)
		{
		System.out.println((maxPeaks+1)+" "+(tempIndex+1));
		}
		else{
		    System.out.println(1+" "+1);
		}

	}

	public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);

		int t= in.nextInt();

		for(int i =0;i<t;i++)
		{
			int n = in.nextInt();
			int k =in.nextInt();
			int [] a = new int [n];

			for(int j=0;j<n;j++)
			{
				a[j] =in.nextInt();
			}

			findAns(n,k,a);

		}

	}

}


package contestTester;

import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {

	private static void findAns(int n, int k ,int [] a)
	{

		int maxPeaks = 0;
		int tempPeaks =0;
		int tempIndex =-1;
		int [] b = new int [n];
		Arrays.fill(b,0);
		for(int i=1;i<a.length-1;i++)
		{
			if(a[i]>a[i-1] && a[i]>a[i+1])
			{
				b[i] =1;
			}

		}

		for(int i =0;i<b.length-k+1;i++)
		{
			tempPeaks =0;

			for(int j =i+1;j<i+k-1;j++)
			{
				if(b[j]==1)
				{
					tempPeaks++;
				}

			}

			if(tempPeaks>maxPeaks)
			{
				maxPeaks =tempPeaks;
				tempIndex= i;
			}

		}

		if(tempIndex!=-1)
		{
		System.out.println((maxPeaks+1)+" "+(tempIndex+1));
		}
		else {
			System.out.println(1+" "+1);
		}

	}

	public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);

		int t= in.nextInt();

		for(int i =0;i<t;i++)
		{
			int n = in.nextInt();
			int k =in.nextInt();
			int [] a = new int [n];

			for(int j=0;j<n;j++)
			{
				a[j] =in.nextInt();
			}

			findAns(n,k,a);

		}

	}

}


#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_bacl
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

const int N = 1e5;
const int INF = 1e9;

char arr[5][110];

int main(){
    int n,k;
    cin>>n>>k;
    int tmp = ((n-2)*2)-k;
    if((tmp==1 || tmp==3)&&n>5) cout<<"NO"<<endl;
    else{
        cout<<"YES"<<endl;
        for(int i=0;i<4;i++){
            for(int j=0;j<n;j++){
                arr[i][j]='.';
            }
        }
        if(k==3){
            arr[1][1]=arr[1][n-2]='#';
            arr[2][n/2]='#';
        }
        else{
            if(k&1){
                arr[1][n/2]='#';
                k--;
            }
            for(int j=1;j<n-1 && k ;j++){
                for(int i=1;i<=2 && k;i++){
                    arr[i][j]='#';
                    k--;
                }
            }
        }

        for(int i=0;i<4;i++){
            for(int j=0;j<n;j++){
                cout<<arr[i][j];
            }
            cout<<endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  ll n,m;
  cin >> n >> m;
  ll blah = (n)*(2) + 2;
  if(m>blah){
    cout << "NO" << endl;
  }
  else{
    cout << "YES" << endl;
    ll cnt = 0;
    for(ll i=0;i<4;i++){
      for(ll j=0;j<n;j++){
        if(i==0 || i==3 || j==n/2)
          cout << ".";
        else if(cnt<m){
          cout << "#";
          cnt+=1;
        }
        else{
          cout << ".";
        }
      }
      if(i!=3)
        cout << endl;
    }
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  char arr[4][a];
  for(int i=0;i<4;i++){
    for(int j=0;j<a;j++){
      arr[i][j]='.';
    }
  }
  cout << "YES" << endl;
  int cnt = 0;
  for(int j=1;j<a/2;j++){
    if(cnt+1>b)
      break;
    arr[1][j]='#';
    cnt+=1;
    if(cnt+1>b)
      break;
    arr[1][a-j-1]='#';
    cnt+=1;
  }
  // cout << cnt << endl;
  if(b-cnt==1){
    arr[1][a/2]='#';
    cnt+=1;
  }
  for(int j=1;j<a/2;j++){
    if(cnt+1>b)
      break;
    arr[2][j]='#';
    cnt+=1;
    if(cnt+1>b)
      break;
    arr[2][a-j-1]='#';
    cnt+=1;
  }
  if(b-cnt==1){
    arr[1][a/2]='#';
  }
  else if(b-cnt==2){
    arr[1][a/2]='#';
    arr[2][a/2]='#';
  }
  for(int i=0;i<4;i++){
    for(int j=0;j<a;j++){
      cout << arr[i][j];
    }
    cout << endl;
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  char arr[4][a];
  for(int i=0;i<4;i++){
    for(int j=0;j<a;j++){
      arr[i][j]='.';
    }
  }
  cout << "YES" << endl;
  int cnt = 0;
  if(b-cnt==1){
    arr[1][a/2]='#';
    cnt+=1;
  }
  for(int j=1;j<a/2;j++){
    if(cnt+2>b)
      break;
    arr[1][j]='#';
    cnt+=1;
    if(cnt+1>b)
      break;
    arr[1][a-j-1]='#';
    cnt+=1;
  }
  // cout << cnt << endl;
  if(b-cnt==1){
    arr[1][a/2]='#';
    cnt+=1;
  }
  for(int j=1;j<a/2;j++){
    if(cnt+2>b)
      break;
    arr[2][j]='#';
    cnt+=1;
    if(cnt+1>b)
      break;
    arr[2][a-j-1]='#';
    cnt+=1;
  }
  if(b-cnt==1){
    arr[1][a/2]='#';
  }
  else if(b-cnt==2){
    arr[1][a/2]='#';
    arr[2][a/2]='#';
  }
  for(int i=0;i<4;i++){
    for(int j=0;j<a;j++){
      cout << arr[i][j];
    }
    cout << endl;
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  int blah = (n-2)*(2);
  if(m>blah){
    cout << "NO" << endl;
  }
  else{
    cout << "YES" << endl;
    int cnt = 0;
    for(int i=0;i<4;i++){
      for(int j=0;j<n;j++){
        if(i==0 || i==3 || j==0 || j==n-1)
          cout << ".";
        else if(cnt<m){
          cout << "#";
          cnt+=1;
        }
        else{
          cout << ".";
        }
      }
      cout << endl;
    }
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  int blah = (n-2)*(2);
  if(m>blah){
    cout << "NO" << endl;
  }
  else{
    cout << "YES" << endl;
    int cnt = 0;
    char arr[4][n];
    for(int i=0;i<4;i++){
      for(int j=0;j<n;j++){
        arr[i][j]='.';
      }
    }
    for(int i=1;i<n-1;i++){
      for(int j=1;j<=2;j++){
        if(cnt>=m)
          break;
        arr[j][i]='#';
        cnt+=1;
      }
      if(cnt>=m)
        break;
    }
    for(int i=0;i<4;i++){
      for(int j=0;j<n;j++){
        cout << arr[i][j];
      }
      cout << endl;
    }
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  int blah = (n-2)*(2);
  if(m>blah){
    cout << "NO" << endl;
  }
  else{
    cout << "YES" << endl;
    int cnt = 0;
    char arr[4][n];
    for(int i=0;i<4;i++){
      for(int j=0;j<n;j++){
        arr[i][j]='.';
      }
    }
    if(m%2==0){
      for(int i=1;i<n-1;i++){
        for(int j=1;j<=2;j++){
          if(cnt>=m)
            break;
          arr[j][i]='#';
          cnt+=1;
        }
        if(cnt>=m)
          break;
      }
    }
    else{
      for(int i=1;i<=2;i++){
        for(int j=1;j<n-1;j++){
          if(cnt>=m)
            break;
          arr[i][j]='#';
          cnt+=1;
        }
        if(cnt>=m)
          break;
      }
    }
    for(int i=0;i<4;i++){
      for(int j=0;j<n;j++){
        cout << arr[i][j];
      }
      cout << endl;
    }
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  ll n,m;
  cin >> n >> m;
  ll blah = (n)*(2) + 4;
  if(m>blah){
    cout << "NO" << endl;
  }
  else{
    cout << "YES" << endl;
    ll cnt = 0;
    for(ll i=0;i<4;i++){
      for(ll j=0;j<n;j++){
        if(i==0 || i==3 || j==n/2)
          cout << ".";
        else if(cnt<m){
          cout << "#";
          cnt+=1;
        }
        else{
          cout << ".";
        }
      }
      if(i!=3)
        cout << endl;
    }
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  char arr[4][a];
  for(int i=0;i<4;i++){
    for(int j=0;j<a;j++){
      arr[i][j]='.';
    }
  }
  cout << "YES" << endl;
  int cnt = 0;
  if(b-cnt==1){
    arr[1][a/2]='#';
    cnt+=1;
  }
  for(int j=1;j<a/2;j++){
    if(cnt+1>b)
      break;
    arr[1][j]='#';
    cnt+=1;
    if(cnt+1>b)
      break;
    arr[1][a-j-1]='#';
    cnt+=1;
  }
  // cout << cnt << endl;
  if(b-cnt==1){
    arr[1][a/2]='#';
    cnt+=1;
  }
  for(int j=1;j<a/2;j++){
    if(cnt+1>b)
      break;
    arr[2][j]='#';
    cnt+=1;
    if(cnt+1>b)
      break;
    arr[2][a-j-1]='#';
    cnt+=1;
  }
  if(b-cnt==1){
    arr[1][a/2]='#';
  }
  else if(b-cnt==2){
    arr[1][a/2]='#';
    arr[2][a/2]='#';
  }
  for(int i=0;i<4;i++){
    for(int j=0;j<a;j++){
      cout << arr[i][j];
    }
    cout << endl;
  }
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#define ll long long
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) prllf("%d",n)
#define pl(n) prllf("%d",n)
using namespace std;

int main(){
  ll n,m;
  cin >> n >> m;
  ll blah = (n-2)*(2);
  if(m>blah){
    cout << "NO" << endl;
  }
  else{
    cout << "YES" << endl;
    ll cnt = 0;
    for(ll i=0;i<4;i++){
      for(ll j=0;j<n;j++){
        if(i==0 || i==3 || j==0 || j==n-1)
          cout << ".";
        else if(cnt<m){
          cout << "#";
          cnt+=1;
        }
        else{
          cout << ".";
        }
      }
      if(i!=3)
        cout << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, k;
	scanf(" %d %d", &n, &k);

	char a[110][110];
	for (int i = 0; i < 4; i++)
		for (int j = 0; j < n; j++)
			a[i][j] = '.';

	for (int i = 1; i < 3; i++){
		for (int j = 1; j < n - 1; j++){
			if (k == 0)
				break;
			if (i + j + abs(i - 3) + abs(n - 1 - j) == abs(i - 3) + j + i + abs(n - 1 - j)){
				k--;
				a[i][j] = '#';
			}
		}
		if (k == 0)
			break;
	}

	if (k == 0){
		printf("YES\n");
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < n; j++){
				printf("%c", a[i][j]);
			}
			printf("\n");
		}
	}
	else{
		printf("NO\n");
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn=1e6+10;
int n,k;
char a[6][109];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>k;
    for(int i=1;i<=4;i++)
        for(int j=1;j<=n;j++) a[i][j]='.';
    int num=k;
    bool f=0;
    if(num%2==0)
    {
        for(int i=1;num&&i<=n-1;i++)
        {
            a[2][i+1]=a[3][i+1]='#';
            num-=2;
        }
        if(num>0) f=0;
        else f=1;
    }
    if(f)
    {
        cout<<"YES"<<endl;
        for(int i=1;i<=4;i++)
        {
            cout<<(a[i]+1)<<endl;
        }
    }
    else
    {
        if(num==n-2)
        {
            for(int i=1;i<n-1;i++) a[2][i+1]='#';
            cout<<"YES"<<endl;
            for(int i=1;i<=4;i++) cout<<(a[i]+1)<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn=1e6+10;
int n,k;
char a[6][109];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>k;
    for(int i=1;i<=4;i++)
        for(int j=1;j<=n;j++) a[i][j]='.';
    int num=k;
    if((n-2)*2<k)
    {
        puts("NO");
        return 0;
    }
    bool f=0;
    if(num%2==0)
    {
        for(int i=1;num&&i<n-1;i++)
        {
            a[2][i+1]=a[3][i+1]='#';
            num-=2;
        }
        if(num>0) f=0;
        else f=1;
    }
    if(f)
    {
        cout<<"YES"<<endl;
        for(int i=1;i<=4;i++)
        {
            cout<<(a[i]+1)<<endl;
        }
    }
    else
    {
        if(num<n-2) puts("NO");
        else
        {
            for(int i=1;num&&i<n-1;i++)
            {
                a[2][i+1]='#';
                num--;
            }
            if(num==0)
            {
                cout<<"YES"<<endl;
                for(int i=1;i<=4;i++)
                {
                    cout<<(a[i]+1)<<endl;
                }
                return 0;
            }
            num--;
            a[3][2]='#';
            for(int i=n-1;num&&i>1;i--)
            {
                a[3][i]='#';
                num--;
            }

            cout<<"YES"<<endl;
            for(int i=1;i<=4;i++)
            {
                cout<<(a[i]+1)<<endl;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn=1e6+10;
int n,k;
char a[6][109];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>k;
    for(int i=1;i<=4;i++)
        for(int j=1;j<=n;j++) a[i][j]='.';
    int num=k;
    if((n-2)*2<k)
    {
        puts("NO");
        return 0;
    }
    bool f=0;
    if(num%2==0)
    {
        for(int i=1;num&&i<n-1;i++)
        {
            a[2][i+1]=a[3][i+1]='#';
            num-=2;
        }
        if(num>0) f=0;
        else f=1;
    }
    if(f)
    {
        cout<<"YES"<<endl;
        for(int i=1;i<=4;i++)
        {
            cout<<(a[i]+1)<<endl;
        }
    }
    else
    {
        if(num==n-2)
        {
            for(int i=1;i<n-1;i++) a[2][i+1]='#';
            cout<<"YES"<<endl;
            for(int i=1;i<=4;i++) cout<<(a[i]+1)<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0,mid=0,start,stop;
	int ncols=k/2;

	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

//	//if k=n-2
//	else if(k==(n-2)){
//		cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(count<k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}

	//odd and k>(n-2) : ncols method
	else if(k%2!=0 && k>(n-2)){
		cout<<"entered";
		cout<<"YES\n";
		ncols = (k+1)/2;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					if(j==(ncols-1) && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//odd and k<(n-2) : arrange in the middle
	else if(k%2!=0 && k<=(n-2)){
		cout<<"YES\n";
		mid = n/2 + 1;
		start = mid - k/2;
		stop = mid + k/2;
		//cout<<"start: "<<start<<" - "<<"stop: "<<stop<<endl;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && (j+1)>=start && (j+1)<=stop){
					cout<<"#";
					count++;
				}
				else{
						cout<<".";
					}
			}
			cout<<endl;
		}

	}

//	//k=1
//	else if(k==1){
//	cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(j==n/2 && count <k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool check(int n, int k){
	return true;
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	if(check(n,k)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0,mid=0,start,stop;
	int ncols=k/2;

	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

//	//if k=n-2
//	else if(k==(n-2)){
//		cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(count<k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}

	//odd and k>(n-2) : ncols method
	else if(k%2!=0 && k>(n-2)){
		cout<<"YES\n";
		ncols = (k+1)/2;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					if(j==(ncols-1) && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//odd and k<(n-2) : arrange in the middle
	else if(k%2!=0 && k<=(n-2)){
		cout<<"YES\n";
		mid = n/2 + 1;
		start = mid - k/2;
		stop = mid + k/2;
		//cout<<"start: "<<start<<" - "<<"stop: "<<stop<<endl;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && (j+1)>=start && (j+1)<=stop){
					cout<<"#";
					count++;
				}
				else{
						cout<<".";
					}
			}
			cout<<endl;
		}

	}

//	//k=1
//	else if(k==1){
//	cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(j==n/2 && count <k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool check(int n, int k){
	if(k>(n-2) && !(2*(n-2))){
		return false;
	}
	else if(k<(n-2) && ((k%2)!=0)){
		return false;
	}
	return true;

}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	if(check(n,k)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

bool check(int p, int l){
	if(p==0){
		return true;
	}
	else if(l%p==0){
		return true;
	}
	else if(p==1){
		return true;
	}

	return false;
}

int main(){

	int i=0,p=0,l=0;
	string s,s1;
	cin>>s;
	while(s[i]){
		if(s[i]=='o'){
			p++;
		}
		else
			l++;
		i++;
	}
//	cout<<"p: "<<p<<" - "<<"l: "<<l<<"\n";
	if(check(p,l)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	cout<<"NO";
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	cout<<"YES";
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool check(int n, int k){
	if(!(k%(n-2))){
		return true;
	}
	else if(!(k%2)){
		return true;
	}
	return false;
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	if(check(n,k)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int i=0,j=0,count=0;
	int ncols=k/2;
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k==(n-2) || (k<(n-2) && k%2!=0)){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k>(n-2) && k%2!=0)
		cout<<"NO";
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0,mid=0,start,stop;
	int ncols=k/2;

	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

//	//if k=n-2
//	else if(k==(n-2)){
//		cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(count<k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}

	//odd and k>(n-2) : ncols method
	else if(k%2!=0 && k>(n-2)){
		cout<<"entered";
		cout<<"YES\n";
		ncols = (k+1)/2;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					if(j==(ncols-1) && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//odd and k<(n-2) : arrange in the middle
	else if(k%2!=0 && k<=(n-2)){
		cout<<"YES\n";
		mid = n/2 + 1;
		start = mid - k/2;
		stop = mid + k/2;
		cout<<"start: "<<start<<" - "<<"stop: "<<stop<<endl;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && (j+1)>=start && (j+1)<=stop){
					cout<<"#";
					count++;
				}
				else{
						cout<<".";
					}
			}
			cout<<endl;
		}

	}

//	//k=1
//	else if(k==1){
//	cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(j==n/2 && count <k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int i=0,j=0,count=0;
	int ncols=k/2;
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k==(n-2) || (k<(n-2) && k%2!=0)){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k>(n-2) && k%2!=0)
		cout<<"NO";
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	cout<<"YES"<<endl;
	int i=0,j=0,count=0;
	int ncols=k/2;
	if(k%2==0){
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k%2!=0){
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
//		cout<<"YES";
//	}
//	else{
//		cout<<"NO";
//	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int i=0,j=0,count=0;
	int ncols=k/2;
	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//if k=n-2 or is less than n-2 and odd
	else if(k<=(n-2) && k!=1){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}
	else if(k==1){
	cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(j==n/2 && count <k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k>(n-2) && k%2!=0)
		cout<<"NO";
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool check(int n, int k){
	int max = 4*n - 8 - (n-2)*2 -2;
	if(k==max+1){
		return false;
	}
	return true;
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	if(check(n,k)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool check(int n, int k){
	int i=0,j=0,count=0;
	for(i=0;i<4;i++){
		for(j=0;j<n;j++){
			if(i==0 || i==4 || j==0 || j==n){
				cout<<".";
			}
			else if(count<k){
				cout<<"#";
				count++;
			}
			else{
				cout<<".";
			}
		}
		cout<<endl;
	}
	return true;
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	if(check(n,k)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool check(int n, int k){
	if(k>(n-2)){
		return false;
	}
	else if(k<(n-2) && ((k%2)!=0)){
		return false;
	}
	int i=0,j=0,count=0;
	for(i=0;i<4;i++){
		for(j=0;j<n;j++){
			if(i==0 || i==4 || j==0 || j==n){
				cout<<".";
			}
			else if(count<k){
				cout<<"#";
				count++;
			}
			else{
				cout<<".";
			}
		}
		cout<<endl;
	}
	return true;

}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	if(check(n,k)){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0,mid=0,start,stop;
	int ncols=k/2;

	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

//	//if k=n-2
//	else if(k==(n-2)){
//		cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(count<k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}

	//odd and k>=(n-2)
	else if(k%2!=0 && k>=(n-4)){
		cout<<"YES\n";
		ncols = (k+1)/2;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					if(j==ncols-1 && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//odd and k<(n-2)
	else if(k%2!=0 && k<(n-2)){
		cout<<"YES\n";
		start = n/2 - k/2;
		stop = start + ncols + 1;
		//cout<<"start: "<<start<<" - "<<"stop: "<<stop<<endl;
		ncols = k/2 + 1;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && start<=j && j<=stop){
					cout<<"#";
					count++;
				}
				else{
						cout<<".";
					}
			}
			cout<<endl;
		}

	}

//	//k=1
//	else if(k==1){
//	cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(j==n/2 && count <k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0,mid=0,start,stop;
	int ncols=k/2;

	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

//	//if k=n-2
//	else if(k==(n-2)){
//		cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(count<k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}

	//odd and k>=(n-2)
	else if(k%2!=0 && k>(n-2)){
		cout<<"YES\n";
		ncols = (k+1)/2;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					if(j==ncols-1 && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//odd and k<(n-2)
	else if(k%2!=0 && k<=(n-2)){
		cout<<"YES\n";
		start = n/2 - k/2;
		stop = start + ncols + 1;
		//cout<<"start: "<<start<<" - "<<"stop: "<<stop<<endl;
		ncols = k/2 + 1;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && start<=j && j<=stop){
					cout<<"#";
					count++;
				}
				else{
						cout<<".";
					}
			}
			cout<<endl;
		}

	}

//	//k=1
//	else if(k==1){
//	cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(j==n/2 && count <k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0,mid=0,start,stop;
	int ncols=k/2;

	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

//	//if k=n-2
//	else if(k==(n-2)){
//		cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(count<k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}

	//odd and k>=(n-2)
	else if(k%2!=0 && k>=(n-2)){
		cout<<"YES\n";
		ncols = (k+1)/2;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					if(j==ncols-1 && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//odd and k<(n-2)
	else if(k%2!=0 && k<(n-2)){
		cout<<"YES\n";
		start = n/2 - k/2;
		stop = start + ncols + 1;
		//cout<<"start: "<<start<<" - "<<"stop: "<<stop<<endl;
		ncols = k/2 + 1;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && start<=j && j<=stop){
					cout<<"#";
					count++;
				}
				else{
						cout<<".";
					}
			}
			cout<<endl;
		}

	}

//	//k=1
//	else if(k==1){
//	cout<<"YES\n";
//		for(i=0;i<4;i++){
//			for(j=0;j<n;j++){
//				if(i==0 || i==3 || j==0 || j==(n-1)){
//					cout<<".";
//				}
//				else if(j==n/2 && count <k){
//					cout<<"#";
//					count++;
//				}
//				else{
//					cout<<".";
//				}
//			}
//			cout<<endl;
//		}
//	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){

	int f=0,i=0,j=0,count=0;
	int ncols=k/2;
	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//if k=n-2
	else if(k==(n-2)){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}
	else if(k<(n-2) && k%2!=0){
		cout<<"YES\n";
		ncols = k/2 + 1;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols ){
					if(j==ncols/2 +1 && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k==1){
	cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(j==n/2 && count <k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k>(n-2) && k%2!=0)
		cout<<"NO";
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){
	int max = 4*n - 2*(n-2) - 4;
	int f=0,i=0,j=0,count=0;
	int ncols=k/2;
	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//if k=n-2
	else if(k==(n-2)){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}
	else if(k%2!=0 && k!=1){
		cout<<"YES\n";
		ncols = k/2 + 1;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols ){
					if(j==ncols-1 && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k==1){
	cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(j==n/2 && count <k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void check(int n, int k){

	int f=0,i=0,j=0,count=0;
	int ncols=k/2;
	//if even, arrange vertically
	if(k%2==0){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==4 || j==0 || j==n){
					cout<<".";
				}
				else if(count<k && j<=ncols){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	//if k=n-2
	else if(k==(n-2)){
		cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}
	else if(k<(n-2) && k%2!=0 && k!=1){
		cout<<"YES\n";
		ncols = k/2 + 1;
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(count<k && j<=ncols ){
					if(j==ncols/2 +1 && i==1){
						cout<<".";
					}
					else{
						cout<<"#";
						count++;
					}
				}

				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k==1){
	cout<<"YES\n";
		for(i=0;i<4;i++){
			for(j=0;j<n;j++){
				if(i==0 || i==3 || j==0 || j==(n-1)){
					cout<<".";
				}
				else if(j==n/2 && count <k){
					cout<<"#";
					count++;
				}
				else{
					cout<<".";
				}
			}
			cout<<endl;
		}
	}

	else if(k>(n-2) && k%2!=0)
		cout<<"NO";
}

int main(){
	SPEED;
	int n,k;
	cin>>n;cin>>k;
	check(n,k);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,m,ok=0;
	cin>>n>>m;
	if(m%2==1)
	{
		if(m<=n-2)
		{
			cout<<"YES"<<endl;
			for(int i=1;i<=4;i++)
			{
				for(int j=1;j<=n;j++)
				{
					if(i==2&&j>(n-m)/2&&j<=(n+m)/2)cout<<"#";
					else cout<<".";
				}
				cout<<endl;
			}
			return 0;
		}
		else
		{
			cout<<"NO"<<endl;
			return 0;
		}
	}
	if(m==2)
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=4;i++)
		{
			for(int j=1;j<=n;j++)
			{
				if((i==2&&j==2)||(i==3&&j==2))cout<<"#";
				else cout<<".";
			}
			cout<<endl;
		}
		return 0;
	}
	cout<<"NO"<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,m,ok=0;
	cin>>n>>m;
	if(m==0)
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=4;i++)
		{
			for(int j=1;j<=n;j++)
			{
				cout<<".";
			}
			cout<<endl;
		}
		return 0;
	}
	if(m%2==1)
	{
		if(m<=n-2)
		{
			cout<<"YES"<<endl;
			for(int i=1;i<=4;i++)
			{
				for(int j=1;j<=n;j++)
				{
					if(i==2&&j>(n-m)/2&&j<=(n+m)/2)cout<<"#";
					else cout<<".";
				}
				cout<<endl;
			}
			return 0;
		}
		else
		{
			cout<<"NO"<<endl;
			return 0;
		}
	}
	if(m==2)
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=4;i++)
		{
			for(int j=1;j<=n;j++)
			{
				if((i==2&&j==2)||(i==3&&j==2))cout<<"#";
				else cout<<".";
			}
			cout<<endl;
		}
		return 0;
	}
	cout<<"NO"<<endl;
	return 0;
}


#include <bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int a[4][100];
void solve(){
    int n,k;
    cin>>n>>k;
    cout<<"YES"<<endl;
    if(k%2){
        a[1][n/2]=1;
        k--;
    }
    int g=1,f=1;
    rep(i,0,k/2){
        a[f][g]=a[f][n-g-1]=1;
        if(f==1) f=2;
        else f=1,g++;
    }
    rep(i,0,4){
        rep(j,0,n){
            if(a[i][j]) cout<<"#";
            else cout<<".";
        }
        cout<<endl;
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int a[4][100];
void solve(){
    int n,k;
    cin>>n>>k;
    if(k==2*n-4){
        rep(i,1,n-1){
            a[1][i]=a[2][i]=1;
        }
    }
    else if(k==2*n-5){
        cout<<"NO"<<endl;
        return;
    }
    else{
        if(k%2==0){
            rep(i,1,n-1){
                a[1][i]=1;
                a[2][i]=1;
                k-=2;
                if(!k) break;
            }
        }
        else{
            if(k<=n-2){
                a[1][n/2]=1;
                k--;
                int g=n/2-1;
                rep(i,0,k/2){
                    a[1][g]=a[1][n-1-g]=1;
                    g--;
                }
            }
            else{
                k-=n-2;
                rep(i,1,n-1){
                    a[1][i]=1;
                }
                int g=n-2;
                rep(i,0,k){
                    a[2][g--]=1;
                }
            }
        }
    }
    cout<<"YES"<<endl;
    rep(i,0,4){
        rep(j,0,n){
            if(a[i][j]) cout<<"#";
            else cout<<".";
        }
        cout<<endl;
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int a[4][100];
void solve(){
    int n,k;
    cin>>n>>k;
    if(k==2*n-4){
        rep(i,1,n-1){
            a[1][i]=a[2][i]=1;
        }
    }
    else{
        if(k%2==0){
            rep(i,1,n-1){
                if(!k) break;
                a[1][i]=1;
                a[2][i]=1;
                k-=2;
            }
        }
        else{
            if(k<=n-2){
                a[1][n/2]=1;
                k--;
                int g=n/2-1;
                rep(i,0,k/2){
                    a[1][g]=a[1][n-1-g]=1;
                    g--;
                }
            }
            else{
                k-=n-2;
                rep(i,1,n-1){
                    a[1][i]=1;
                }
                if(k){
                    k-=2;
                    a[2][1]=1;
                    a[2][n-2]=1;
                    rep(i,0,k){
                        a[2][i+2]=1;
                    }
                }
            }
        }
    }
    cout<<"YES"<<endl;
    rep(i,0,4){
        rep(j,0,n){
            if(a[i][j]) cout<<"#";
            else cout<<".";
        }
        cout<<endl;
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int a[4][100];
void solve(){
    int n,k;
    cin>>n>>k;
    if(k==2*n-4){
        rep(i,1,n-1){
            a[1][i]=a[2][i]=1;
        }
    }
    else if(k==2*n-5){
        cout<<"NO"<<endl;
        return;
    }
    else{
        if(k%2==0){
            rep(i,1,n-1){
                if(!k) break;
                a[1][i]=1;
                a[2][i]=1;
                k-=2;
            }
        }
        else{
            if(k<=n-2){
                a[1][n/2]=1;
                k--;
                int g=n/2-1;
                rep(i,0,k/2){
                    a[1][g]=a[1][n-1-g]=1;
                    g--;
                }
            }
            else{
                k-=n-2;
                rep(i,1,n-1){
                    a[1][i]=1;
                }
                if(k){
                    k-=2;
                    a[2][1]=1;
                    a[2][n-2]=1;
                    rep(i,0,k){
                        a[2][i+2]=1;
                    }
                }
            }
        }
    }
    cout<<"YES"<<endl;
    rep(i,0,4){
        rep(j,0,n){
            if(a[i][j]) cout<<"#";
            else cout<<".";
        }
        cout<<endl;
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}