#include <bits/stdc++.h>
using namespace std;
string s, t;
int cnt[30];
const int mn = 2e5 + 10;
int l[mn][30];
int r[mn][30];
int lt[mn][30];
int rt[mn][30];
int b1[mn];
int b2[mn];
bool can() {
  int ind = 0;
  int sz = s.size();
  int sz2 = t.size();
  b1[0] = (t[0] == s[0]);
  ind = b1[0];
  for (int i = 0; i < sz; i++) {
    if (!i) continue;
    if (ind < sz2 && s[i] == t[ind]) {
      b1[i] = b1[i - 1] + 1;
      ind++;
    } else
      b1[i] = b1[i - 1];
  }
  b2[sz - 1] = (s[sz - 1] == t[sz2 - 1]);
  ind = sz2 - 1 - b2[sz - 1];
  for (int i = 0; i < sz; i++) {
    if (!i) continue;
    if (ind >= 0 && s[sz - 1 - i] == t[ind]) {
      b2[sz - 1 - i] = b2[sz - i] + 1;
      ind--;
    } else
      b2[sz - 1 - i] = b2[sz - i];
  }
  for (int i = 0; i < sz; i++) {
    int a1, a2;
    a1 = b1[i];
    a2 = b2[i];
    if (a1 <= 0 || a2 <= 0) return false;
    a1--;
    a2--;
    a1 = lt[a1][s[i] - 'a'];
    a2 = rt[sz2 - 1 - a2][s[i] - 'a'];
    if (a1 < 0 || a2 < 0) return false;
    a2 = sz2 - a2;
    if (a1 + a2 >= sz2) continue;
    return false;
  }
  return true;
}
int main() {
  cin >> s >> t;
  memset(cnt, 0, sizeof cnt);
  memset(l, -1, sizeof l);
  memset(r, -1, sizeof r);
  memset(lt, -1, sizeof lt);
  memset(rt, -1, sizeof rt);
  l[0][s[0] - 'a'] = 0;
  int sz = s.size();
  r[sz - 1][s[sz - 1] - 'a'] = sz - 1;
  for (int i = 0; i < sz; i++) {
    if (!i) continue;
    for (int j = 0; j < 30; j++) l[i][j] = l[i - 1][j];
    l[i][s[i] - 'a'] = i;
  }
  for (int i = 0; i < sz; i++) {
    if (i == 0) continue;
    for (int j = 0; j < 30; j++) r[sz - 1 - i][j] = r[sz - i][j];
    r[sz - 1 - i][s[sz - 1 - i] - 'a'] = sz - 1 - i;
  }
  sz = t.size();
  lt[0][t[0] - 'a'] = 0;
  rt[sz - 1][t[sz - 1] - 'a'] = sz - 1;
  for (int i = 0; i < sz; i++) {
    if (!i) continue;
    for (int j = 0; j < 30; j++) lt[i][j] = lt[i - 1][j];
    lt[i][t[i] - 'a'] = i;
  }
  for (int i = 0; i < sz; i++) {
    if (i == 0) continue;
    for (int j = 0; j < 30; j++) rt[sz - 1 - i][j] = rt[sz - i][j];
    rt[sz - 1 - i][t[sz - 1 - i] - 'a'] = sz - 1 - i;
  }
  if (can())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
