You are given three strings A, B and C. Check whether they form a word chain.

More formally, determine whether both of the following are true:

* The last character in A and the initial character in B are the same.
* The last character in B and the initial character in C are the same.



If both are true, print `YES`. Otherwise, print `NO`.

Constraints

* A, B and C are all composed of lowercase English letters (`a` - `z`).
* 1 ≤ |A|, |B|, |C| ≤ 10, where |A|, |B| and |C| are the lengths of A, B and C, respectively.

Input

Input is given from Standard Input in the following format:


A B C


Output

Print `YES` or `NO`.

Examples

Input

rng gorilla apple


Output

YES


Input

yakiniku unagi sushi


Output

NO


Input

a a a


Output

YES


Input

aaaaaaaaab aaaaaaaaaa aaaaaaaaab


Output

NO
#include <bits/stdc++.h>
using namespace std;
template <class T>
T mod(T a) {
  if (a < 0) {
    a += 1000000007;
  }
  return a % 1000000007;
}
template <class T>
T addmod(T a, T b) {
  return (mod(a) + mod(b)) % 1000000007;
}
template <class T>
T prodmod(T a, T b) {
  return (mod(a) * mod(b)) % 1000000007;
}
template <class T>
T bin_exp(T a, T b) {
  T res = 1;
  T temp = 1;
  if (b <= 1) return a;
  if (b % 2 == 0)
    res = bin_exp(a * a, b / 2);
  else {
    res *= a;
    temp = bin_exp(a, --b);
  }
  return res * temp;
}
template <class T>
T bin_expmod(T a, T b) {
  T res = 1;
  T temp = 1;
  if (b <= 1) return a;
  if (b % 2 == 0)
    res = bin_expmod(prodmod(a, a), b / 2);
  else {
    res = prodmod(a, res);
    temp = bin_exp(a, --b);
  }
  return prodmod(res, temp);
}
template <class T>
int digit(T a) {
  vector<long long> dig = {0,
                           9,
                           99,
                           999,
                           9999,
                           99999,
                           999999,
                           9999999,
                           99999999,
                           999999999,
                           9999999999,
                           99999999999,
                           999999999999,
                           9999999999999,
                           99999999999999,
                           999999999999999,
                           9999999999999999,
                           99999999999999999,
                           999999999999999999,
                           INT64_MAX};
  auto it = lower_bound(dig.begin(), dig.end(), a);
  int idx = (it - dig.begin());
  return idx;
}
template <class T>
int sumAllInts(T n) {
  int a = 1;
  int su = 0;
  while (n) {
    su += n % 10;
    n /= 10;
  }
  return su;
}
template <class T>
void split(char c, T s) {
  int n = s.size();
  int i = 0;
  while ((cout << s[i], i += 1) && (i < n) && (cout << c << ' '))
    ;
}
void solve() {
  long long int N, T;
  cin >> N >> T;
  vector<int> A(N);
  for (unsigned int i = 0; i < A.size(); i++) cin >> A[i];
  long long int total = T;
  for (unsigned int i = 0; i < A.size(); i++) {
    if (A[i] - A[i - 1] >= T) total += T;
  }
  cout << total;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
