#include <bits/stdc++.h>
using namespace std;
int n, k;
char mp[5][110];
int main() {
  cin >> n >> k;
  for (int i = 0; i < 5; i++)
    for (int j = 0; j <= n; j++) mp[i][j] = '.';
  if (k % 2 == 0) {
    for (int i = 2; i < k / 2 + 2; i++) mp[3][i] = mp[2][i] = '#';
  } else {
    if (k <= n - 2) {
      mp[2][n / 2 + 1] = '#';
      k--;
      int x = k / 2;
      for (int i = n / 2; i > 1; i--) {
        if (x == 0) break;
        mp[2][i] = '#';
        x--;
      }
      x = k / 2;
      for (int i = n / 2 + 2; i < n; i++) {
        if (x == 0) break;
        mp[2][i] = '#';
        x--;
      }
    } else {
      int x = (n - 2) / 2;
      mp[2][n / 2 + 1] = '#';
      for (int i = n / 2; i > 1; i--) {
        if (x == 0) break;
        mp[2][i] = '#';
        x--;
      }
      x = (n - 2) / 2;
      for (int i = n / 2 + 2; i < n; i++) {
        if (x == 0) break;
        mp[2][i] = '#';
        x--;
      }
      k -= (n - 2);
      for (int i = n / 2, j = n / 2 + 2; i > 1 && j < n; i--, j++) {
        if (k == 0) break;
        mp[3][i] = mp[3][j] = '#';
        k -= 2;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i < 5; i++) {
    for (int j = 1; j <= n; j++) cout << mp[i][j];
    cout << endl;
  }
  return 0;
}
