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