#include <iostream>
using namespace std;
int main() {
    int A, B;
    cin >> A >> B;
    
    bool can;
    
    if  (A > 8 || B > 8) can = false;
    else can = true;
    
    if (can) cout << "Yay!" << endl;
    else cout << ":(" << endl;
}
#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

string a, b, c;
int main() {
    cin >> a >> b >> c;
    bool ok = true;
    if (a.back() != b.front())
        ok = false;
    if (b.back() != c.front())
        ok = false;
    if (ok)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}
