#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;
queue<int> q;
deque<int> dq;
char mat[4][100];
int main() {
  int n, k, t;
  scanf("%d %d", &n, &k);
  memset(mat, '.', sizeof(mat));
  if (k % 2 == 0) {
    t = k / 2;
    for (int i = 1; i <= t; i++) mat[1][i] = mat[2][i] = '#';
  } else {
    t = n / 2;
    k++;
    for (int i = 0; i < t && k; i++) {
      mat[1][t + i] = mat[1][t - i] = '#';
      k -= 2;
    }
    for (int i = 1; i < t && k; i++) {
      mat[2][t + i] = mat[2][t - i] = '#';
      k -= 2;
    }
  }
  printf("YES\n");
  for (int i = 0; i < 4; i++) {
    mat[i][n] = 0;
    printf("%s\n", mat[i]);
  }
}
