#include <bits/stdc++.h>
using namespace std;
void printmap(vector<vector<char>> &map) {
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < map[i].size(); ++j) cout << map[i][j];
    cout << endl;
  }
};
int main() {
  int n, k;
  cin >> n >> k;
  vector<vector<char>> map(4, vector<char>(n, '.'));
  if (k % 2 == 0) {
    printf("YES\n");
    int i = 1;
    while (k > 0) {
      map[1][i] = '#';
      map[2][i] = '#';
      k -= 2;
      ++i;
    };
    printmap(map);
  } else if (k <= n - 2) {
    printf("YES\n");
    int i = 1;
    int j = 0;
    map[1][n / 2] = '#';
    k--;
    ++j;
    while (k > 0) {
      map[1][n / 2 - j] = '#';
      map[1][n / 2 + j] = '#';
      ++j;
      k -= 2;
    };
    printmap(map);
  } else {
    printf("YES\n");
    int i = 1;
    ++k;
    while (k > 0) {
      map[1][i] = '#';
      map[2][i] = '#';
      k -= 2;
      ++i;
    };
    map[1][2] = '.';
    printmap(map);
  }
}
