#include <bits/stdc++.h>
using namespace std;
const int N = 500005, M = 1000000;
const double EPS = 1e-9;
int n, m, l[300000], r[300000], ck[300000];
string s, t;
vector<int> L[30], R[30];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> s >> t;
  n = s.size(), m = t.size();
  int j = m - 1, i = n - 1;
  while (j > -1 && i > -1) {
    r[i] = r[i + 1];
    if (s[i] == t[j]) r[i]++, j--;
    i--;
  }
  if (j > -1) {
    cout << "No";
    return 0;
  } else {
    for (; i > -1; i--) r[i] = r[i + 1];
  }
  i = 0, j = 0;
  while (i < n && j < m) {
    if (i) l[i] = l[i - 1];
    if (s[i] == t[j]) l[i]++, j++;
    i++;
  }
  if (j < m) {
    cout << "No";
    return 0;
  } else {
    for (; i < n; i++) l[i] = l[i - 1];
  }
  j = 0;
  for (int i = 0; i < n; i++) {
    if (j < m && s[i] == t[j])
      L[s[i] - 'a'].push_back(i), ck[i] = 1, j++;
    else {
      if (L[s[i] - 'a'].size()) {
        int g = L[s[i] - 'a'][L[s[i] - 'a'].size() - 1];
        if (l[g] + r[i] >= m) ck[i] = 1;
      }
    }
  }
  j = m - 1;
  for (int i = n - 1; i > -1; i--) {
    if (j > -1 && s[i] == t[j])
      R[s[i] - 'a'].push_back(i), ck[i] = 1, j--;
    else {
      if (R[s[i] - 'a'].size()) {
        int g = L[s[i] - 'a'][L[s[i] - 'a'].size() - 1];
        if (r[g] + l[i] >= m) ck[i] = 1;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) ans += ck[i];
  if (ans == n)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
