#include <bits/stdc++.h>
using namespace std;
bool inGrid(int x, int y) { return (x < 4 && x >= 0 && y < 4 && y >= 0); }
int main() {
  char grid[4][4];
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) cin >> grid[i][j];
  const int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
  const int dy[8] = {0, -1, -1, -1, 0, 1, 1, 1};
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (grid[i][j] != '.') continue;
      grid[i][j] = 'x';
      for (int I = 0; I < 4; I++)
        for (int J = 0; J < 4; J++)
          for (int dir = 0; dir < 8; dir++) {
            bool won = true;
            for (int k = 0; k < 3; k++) {
              if (!inGrid(I + k * dx[dir], J + k * dy[dir]))
                won = false;
              else if (grid[I + k * dx[dir]][J + k * dy[dir]] != 'x')
                won = false;
            }
            if (won) {
              cout << "YES" << endl;
              return 0;
            }
          }
      grid[i][j] = '.';
    }
  cout << "NO" << endl;
}
