#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int const N = 1e6 + 10, M = 1e7 + 1, oo = 1e9;
const int mod = oo + 7;
const long long OO = 3e18;
string s, t;
int app[26], ke[2][N], mt[N][26];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s >> t;
  int n = s.size(), m = t.size();
  int l = 0;
  for (int i = 0; i < n; i++) {
    if (l == m) {
      ke[0][i] = ke[0][i - 1];
      continue;
    }
    if (i) ke[0][i] = ke[0][i - 1];
    if (s[i] == t[l]) {
      ke[0][i]++;
      app[s[i] - 'a'] = 1;
      l++;
    } else if (!app[s[i] - 'a']) {
      cout << "No\n";
      return 0;
    }
  }
  if (l != m) {
    cout << "No\n";
    return 0;
  }
  memset(app, 0, sizeof app);
  l = 0;
  memset(mt, -1, sizeof mt);
  for (int i = n - 1; i > -1; i--) {
    if (l == m) {
      ke[1][i] = ke[1][i + 1];
      continue;
    }
    for (int j = 0; j < 26; j++) mt[i][j] = mt[i + 1][j];
    ke[1][i] = ke[1][i + 1];
    if (s[i] == t[m - l - 1]) {
      app[s[i] - 'a'] = 1;
      mt[i][s[i] - 'a'] = i;
      ke[1][i]++;
      l++;
    } else if (!app[s[i] - 'a']) {
      cout << "No\n";
      return 0;
    }
  }
  if (l != m) {
    cout << "No\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (!app[s[i] - 'a']) {
      cout << "No\n";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (mt[i][s[i] - 'a'] == -1 || i == mt[i][s[i] - 'a']) continue;
    int l = 0, r = ke[1][mt[i][s[i] - 'a']];
    if (mt[i][s[i] - 'a'] - 1 >= 0) l = ke[0][i];
    if (l + r < m) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
