#include <bits/stdc++.h>
using namespace std;
const int S = 50;
int ans[4][1000];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  if (k % 2 == 0) {
    for (int j = 1; j <= k / 2; j++)
      for (int i = 1; i < 3; i++) ans[i][j] = 1;
  } else if (n % 2 == 0 || k == n - 1)
    return !printf("NO\n");
  else if (k > n - 1) {
    k--;
    for (int i = 1; i < 3; i++)
      for (int j = 1; j < n - 1; j++)
        if (k) {
          k--;
          ans[i][j] = 1;
        }
    ans[2][n - 2] = 1;
  } else {
    ans[1][n / 2] = 1;
    for (int i = 1; i <= k / 2; i++) ans[1][n / 2 - i] = ans[1][n / 2 + i] = 1;
  }
  printf("YES\n");
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < n; j++) printf("%c", (ans[i][j]) ? '#' : '.');
    printf("\n");
  }
  return 0;
}
