#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  printf("YES\n");
  if (k == 0) {
    for (int l = 0; l < 4; ++l) {
      for (int i = 0; i < n; ++i) printf(".");
      printf("\n");
    }
    return 0;
  }
  if (k % 2 == 0) {
    int m1 = k / 2, m2 = k / 2;
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
    printf(".");
    for (int i = 0; i < m1; ++i) printf("#");
    for (int i = m1 + 1; i < n; ++i) printf(".");
    printf("\n");
    printf(".");
    for (int i = 0; i < m2; ++i) printf("#");
    for (int i = m2 + 1; i < n; ++i) printf(".");
    printf("\n");
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
    return 0;
  }
  if (k <= n - 2) {
    string s;
    s.assign(n, '.');
    int center = n / 2;
    s[center] = '#';
    --k;
    for (int i = 1; i <= k / 2; ++i) {
      s[center + i] = '#';
      s[center - i] = '#';
    }
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
    printf("%s\n", s.c_str());
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
    return 0;
  }
  {
    string s;
    s.assign(n, '.');
    int center = n / 2;
    k -= n - 2;
    for (int i = 1; i <= k / 2; ++i) {
      s[center + i] = '#';
      s[center - i] = '#';
    }
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
    printf(".");
    for (int i = 1; i < n - 1; ++i) printf("#");
    printf(".\n");
    printf("%s\n", s.c_str());
    for (int i = 0; i < n; ++i) printf(".");
    printf("\n");
  }
  return 0;
}
