#include <bits/stdc++.h>
using namespace std;
bool vis[1005][1005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  printf("YES\n");
  if (m % 2) vis[2][n / 2 + 1] = true;
  m = m / 2;
  for (int i = 2; i <= 3; ++i)
    for (int j = 2; j <= n / 2; ++j) {
      if (m) {
        vis[i][j] = vis[i][n - j + 1] = true;
        m--;
      }
    }
  if (m == 1) {
    vis[3][(n + 1) / 2] = true;
    vis[2][(n + 1) / 2] = true;
  }
  for (int i = 1; i <= 4; ++i) {
    for (int j = 1; j <= n; ++j) printf("%c", vis[i][j] ? '#' : '.');
    printf("\n");
  }
}
