#include <bits/stdc++.h>
using namespace std;
char ch[4][4];
int pic[4][4];
int cal() {
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j <= 1; j++) {
      if (ch[i][j] == 'x' && ch[i][j + 1] == 'x' && ch[i][j + 2] == 'x') {
        return 1;
      }
    }
  }
  for (j = 0; j <= 1; j++) {
    for (i = 0; i < 4; i++) {
      if (ch[j][i] == 'x' && ch[j + 1][i] == 'x' && ch[j + 2][i] == 'x') {
        return 1;
      }
    }
  }
  for (i = 0; i <= 1; i++) {
    for (j = 0; j <= 1; j++) {
      if (ch[i][j] == 'x' && ch[i + 1][j + 1] == 'x' &&
          ch[i + 2][j + 2] == 'x') {
        return 1;
      }
    }
  }
  for (i = 0; i <= 1; i++) {
    for (j = 2; j < 4; j++) {
      if (ch[i][j] == 'x' && ch[i + 1][j - 1] == 'x' &&
          ch[i + 2][j - 2] == 'x') {
        return 1;
      }
    }
  }
  return 0;
}
int main() {
  for (int i = 0; i < 4; i++) cin >> ch[i];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (ch[i][j] == '.') {
        ch[i][j] = 'x';
        if (cal() == 1) {
          cout << "Yes" << endl;
          return 0;
        }
        ch[i][j] = '.';
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
