#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
string s, t;
int n, m, l[N], r[N], c[26], j;
int main() {
  cin >> s >> t;
  n = s.size(), m = t.size();
  memset(c, -1, sizeof c);
  for (int i = 0; i < n; i++) {
    if (j < m && t[j] == s[i]) c[s[i] - 'a'] = j++;
    l[i] = c[s[i] - 'a'];
  }
  memset(c, -1, sizeof c);
  j = m - 1;
  for (int i = n - 1; i >= 0; i--) {
    if (j >= 0 && t[j] == s[i]) c[s[i] - 'a'] = j--;
    r[i] = c[s[i] - 'a'];
  }
  for (int i = 0; i < n; i++)
    if (l[i] == -1 || r[i] == -1 || l[i] < r[i]) return cout << "No", 0;
  cout << "Yes";
}
