#include <bits/stdc++.h>
int main() {
  int n;
  int k;
  int x, y;
  int type;
  int odd_num;
  scanf("%d", &n);
  scanf("%d", &k);
  odd_num = ((n - 2) - k) / 2;
  if (k % 2 == 0) {
    printf("YES\n");
    type = 0;
  }
  if (k % 2 != 0 && k >= 5 && n >= 5) {
    printf("YES\n");
    type = 1;
  }
  if (k % 2 != 0 && k < 5 && n % 2 != 0) {
    printf("YES\n");
    type = 2;
  }
  if (k % 2 != 0 && k < 5 && n % 2 == 0) {
    printf("NO");
    exit(0);
  }
  for (x = 0; x < n; x++) {
    printf(".");
  }
  printf("\n");
  for (y = 1; y < 3; y++) {
    printf(".");
    if (type == 0) {
      for (x = 0; x < k / 2; x++) {
        printf("#");
      }
      for (x = 0; x < n - (k / 2 + 2); x++) {
        printf(".");
      }
    }
    if (type == 1 && y == 1) {
      for (x = 0; x < (k + 1) / 2; x++) {
        printf("#");
      }
      for (x = 0; x < n - (((k + 1) / 2) + 2); x++) {
        printf(".");
      }
    }
    if (type == 1 && y == 2) {
      printf("#");
      for (x = 0; x < (k - 5) / 2; x++) {
        printf("#");
      }
      printf(".");
      printf("#");
      for (x = 0; x < n - (((k + 1) / 2) + 2); x++) {
        printf(".");
      }
    }
    if (type == 2 && y == 1) {
      for (x = 0; x < odd_num; x++) {
        printf(".");
      }
      for (x = 0; x < k; x++) {
        printf("#");
      }
      for (x = 0; x < odd_num; x++) {
        printf(".");
      }
    }
    if (type == 2 && y == 2) {
      for (x = 0; x < n - 2; x++) {
        printf(".");
      }
    }
    printf(".");
    printf("\n");
  }
  for (x = 0; x < n; x++) {
    printf(".");
  }
  return (0);
}
