#include <bits/stdc++.h>
using namespace std;
long long int mpow(long long int exp, long long int base);
void aeh() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
}
int32_t main() {
  aeh();
  char a[4][4];
  for (long long int i = 0; i < 4; i++) {
    for (long long int j = 0; j < 4; j++) {
      cin >> a[i][j];
    }
  }
  string ans = "NO";
  for (long long int i = 0; i < 4; i++) {
    for (long long int j = 0; j < 2; j++) {
      vector<char> b;
      for (long long int k = 0; k < 3; k++) {
        b.push_back(a[i][j + k]);
      }
      sort((b).begin(), (b).end());
      long long int x = 0, z = 0;
      for (long long int k = 0; k < 3; k++) {
        if (b[k] == 'x')
          x++;
        else if (b[k] == 'o')
          z++;
      }
      if (x == 2 && z == 0) {
        ans = "YES";
        i = 4;
        break;
      }
    }
  }
  for (long long int i = 0; i < 2; i++) {
    for (long long int j = 0; j < 4; j++) {
      vector<char> b;
      for (long long int k = 0; k < 3; k++) {
        b.push_back(a[i + k][j]);
      }
      sort((b).begin(), (b).end());
      long long int x = 0, z = 0;
      for (long long int k = 0; k < 3; k++) {
        if (b[k] == 'x')
          x++;
        else if (b[k] == 'o')
          z++;
      }
      if (x == 2 && z == 0) {
        ans = "YES";
        i = 4;
        break;
      }
    }
  }
  for (long long int i = 0; i < 2; i++) {
    for (long long int j = 0; j < 2; j++) {
      vector<char> b;
      for (long long int k = 0; k < 3; k++) {
        b.push_back(a[i + k][j + k]);
      }
      sort((b).begin(), (b).end());
      long long int x = 0, z = 0;
      for (long long int k = 0; k < 3; k++) {
        if (b[k] == 'x')
          x++;
        else if (b[k] == 'o')
          z++;
      }
      if (x == 2 && z == 0) {
        ans = "YES";
        i = 4;
        break;
      }
    }
  }
  for (long long int i = 0; i < 2; i++) {
    for (long long int j = 2; j < 4; j++) {
      vector<char> b;
      for (long long int k = 0; k < 3; k++) {
        b.push_back(a[i + k][j - k]);
      }
      sort((b).begin(), (b).end());
      long long int x = 0, z = 0;
      for (long long int k = 0; k < 3; k++) {
        if (b[k] == 'x')
          x++;
        else if (b[k] == 'o')
          z++;
      }
      if (x == 2 && z == 0) {
        ans = "YES";
        i = 4;
        break;
      }
    }
  }
  cout << ans << endl;
}
long long int mpow(long long int base, long long int exp) {
  base %= 1000000007;
  long long int result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % 1000000007;
    base = (base * base) % 1000000007;
    exp >>= 1;
  }
  return result;
}
