#include <bits/stdc++.h>
using namespace std;
char mp[10][105];
int allc, targ;
int main() {
  scanf("%d%d", &allc, &targ);
  printf("YES\n");
  if (targ == 2 * (allc - 2) && allc != 2) mp[3][allc / 2 + 1] = '#';
  for (int j = 2; j < allc; ++j) {
    for (int i = 2; i <= 3; ++i) {
      if (targ <= 1) break;
      mp[i][j] = '#';
      mp[i][allc - j + 1] = '#';
      targ -= 2;
      if (targ <= 1) break;
    }
    if (targ <= 1) break;
  }
  if (targ == 1) mp[2][allc / 2 + 1] = '#';
  for (int i = 1; i <= 4; ++i) {
    for (int j = 1; j <= allc; ++j) {
      if (mp[i][j] == '#')
        printf("%c", mp[i][j]);
      else
        printf(".");
    }
    printf("\n");
  }
  return 0;
}
