#include <bits/stdc++.h>
using namespace std;
char ans[4][500];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int i = 1, j = 1;
  for (int i = 0; i < 4; ++i)
    for (int j = 0; j < n; ++j) ans[i][j] = '.';
  printf("YES\n");
  while (k >= 2) {
    while (j == n - j - 1 && i <= 2) {
      ++i;
      j = 1;
    }
    if (i > 2) break;
    ans[i][j] = ans[i][n - j - 1] = '#';
    k -= 2;
    ++j;
  }
  int col = 1;
  while (k--) {
    ans[col++][n / 2] = '#';
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < n; ++j) {
      printf("%c", ans[i][j]);
    }
    printf("\n");
  }
  return 0;
}
