#include <bits/stdc++.h>
using namespace std;
char mat[4][4];
int diag1(int i, int j) {
  int nx = 0, nv = 0;
  for (int k = 0; k < 3; k++) {
    if (mat[i + k][j + k] == 'x')
      nx++;
    else if (mat[i + k][j + k] == '.')
      nv++;
  }
  if ((nx == 2) && (nv == 1)) return 1;
  return 0;
}
int diag2(int i, int j) {
  int nx = 0, nv = 0;
  for (int k = 0; k < 3; k++) {
    if (mat[i + k][j - k] == 'x')
      nx++;
    else if (mat[i + k][j - k] == '.')
      nv++;
  }
  if ((nx == 2) && (nv == 1)) return 1;
  return 0;
}
int main() {
  int win = 0, nx = 0, nv = 0;
  char prim;
  for (int i = 0; i <= 3; i++) {
    nx = 0;
    nv = 0;
    for (int j = 0; j <= 3; j++) {
      cin >> mat[i][j];
      if (j == 0) prim = mat[i][j];
      if (mat[i][j] == 'x')
        nx++;
      else if (mat[i][j] == '.')
        nv++;
      if ((j == 3) && (prim == 'x'))
        nx--;
      else if ((j == 3) && (prim == '.'))
        nv--;
      if ((nx == 2) && (nv == 1)) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  for (int j = 0; j <= 3; j++) {
    nx = 0;
    nv = 0;
    for (int i = 0; i <= 3; i++) {
      if (i == 0) prim = mat[i][j];
      if (mat[i][j] == 'x')
        nx++;
      else if (mat[i][j] == '.')
        nv++;
      if ((i == 3) && (prim == 'x'))
        nx--;
      else if ((i == 3) && (prim == '.'))
        nv--;
      if ((nx == 2) && (nv == 1)) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  for (int j = 0; j <= 3; j++) {
    nx = 0;
    nv = 0;
    for (int i = 0; i <= 3; i++) {
      if (i == 0) prim = mat[i][j];
      if (mat[i][j] == 'x')
        nx++;
      else if (mat[i][j] == '.')
        nv++;
      if ((i == 3) && (prim == 'x'))
        nx--;
      else if ((i == 3) && (prim == '.'))
        nv--;
      if ((nx == 2) && (nv == 1)) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  if (diag1(0, 0) || diag1(0, 1) || diag1(1, 0) || diag1(1, 1)) {
    cout << "YES" << endl;
    return 0;
  }
  if (diag2(0, 3) || diag2(0, 2) || diag2(1, 3) || diag2(1, 2)) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
