#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  while (~scanf("%d%d", &n, &k)) {
    printf("YES\n");
    for (int i = 0; i < n; i++) putchar('.');
    putchar('\n');
    if (k % 2 == 0) {
      int i = 0;
      putchar('.');
      for (i = 0; i < k / 2; i++) putchar('#');
      for (; i < n - 1; i++) putchar('.');
      printf("\n.");
      for (i = 0; i < k / 2; i++) putchar('#');
      for (; i < n - 1; i++) putchar('.');
      putchar('\n');
    } else {
      int t = -1;
      if (k > n - 2) {
        t = k - (n - 2);
        k = n - 2;
      }
      for (int i = 1; i <= n; i++)
        abs(i - (n + 1) / 2) <= k / 2 ? putchar('#') : putchar('.');
      putchar('\n');
      if (t != -1)
        k = t;
      else
        k = 0;
      for (int i = 1; i <= n; i++)
        abs(i - (n + 1) / 2) <= k / 2 && i != (n + 1) / 2 ? putchar('#')
                                                          : putchar('.');
      putchar('\n');
    }
    for (int i = 0; i < n; i++) putchar('.');
    putchar('\n');
  }
  return 0;
}
