#include <bits/stdc++.h>
using namespace std;
char a[5][200];
int main(void) {
  int i, j, n, m;
  scanf("%d%d", &n, &m);
  memset(a, 0, sizeof(a));
  for (i = 1; i <= 4; i++)
    for (j = 1; j <= n; j++) a[i][j] = '.';
  if (m % 2 == 0) {
    for (j = 2; j < n && m >= 2; j++) {
      a[2][j] = a[3][j] = '#';
      m -= 2;
    }
    printf("YES\n");
    printf("%s\n%s\n%s\n%s", &a[1][1], &a[2][1], &a[3][1], &a[4][1]);
  } else if (m >= 5) {
    a[2][2] = a[3][2] = a[2][3] = '#';
    m -= 3;
    for (j = 4; j < n && m; j++) {
      a[2][j] = a[3][j] = '#';
      m -= 2;
    }
    printf("YES\n");
    printf("%s\n%s\n%s\n%s", &a[1][1], &a[2][1], &a[3][1], &a[4][1]);
  } else if (m == 1) {
    a[2][(n + 1) / 2] = '#';
    printf("YES\n");
    printf("%s\n%s\n%s\n%s", &a[1][1], &a[2][1], &a[3][1], &a[4][1]);
  } else if (m == 3) {
    int k = (n + 1) / 2;
    a[2][k] = a[2][k - 1] = a[2][k + 1] = '#';
    printf("YES\n");
    printf("%s\n%s\n%s\n%s", &a[1][1], &a[2][1], &a[3][1], &a[4][1]);
  }
  return 0;
}
