#include <bits/stdc++.h>
using namespace std;
char s[10][10];
int ii;
int fl = 0;
void pan() {
  char ch;
  if (ii & 1)
    ch = 'x';
  else
    ch = 'o';
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= 4; j++)
      if (s[i][j] == ch) {
        if (j <= 2) {
          if (s[i][j + 1] == ch && s[i][j + 2] == ch) {
            fl = 1;
            return;
          }
        }
        if (i <= 2) {
          if (s[i + 1][j] == ch && s[i + 2][j] == ch) {
            fl = 1;
            return;
          }
        }
        if (i <= 2 && j <= 2) {
          if (s[i + 1][j + 1] == ch && s[i + 2][j + 2] == ch) {
            fl = 1;
            return;
          }
        }
        if (i <= 2 && j >= 3) {
          if (s[i + 1][j - 1] == ch && s[i + 2][j - 2] == ch) {
            fl = 1;
            return;
          }
        }
      }
}
void work(int play, int d) {
  if (d == 0) {
    pan();
    return;
  }
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= 4; j++)
      if (s[i][j] == '.') {
        if (!play)
          s[i][j] = 'x';
        else
          s[i][j] = 'o';
        work(play ^ 1, d - 1);
        s[i][j] = '.';
      }
  return;
}
int main() {
  for (int i = 1; i <= 4; i++) scanf("%s", s[i] + 1);
  for (ii = 1; ii <= 1; ii++) {
    work(0, ii);
    if (fl) {
      printf("YES\n");
    } else
      printf("NO\n");
  }
}
