#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 100;
int Dp[maxn], dp[maxn], dd[100];
int main() {
  ios_base::sync_with_stdio(false);
  string s, k;
  cin >> s >> k;
  int x = 0;
  memset(dd, -1, sizeof dd);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == k[x]) {
      dd[s[i] - 'a'] = x;
      x++;
    }
    dp[i] = dd[s[i] - 'a'];
  }
  memset(dd, -1, sizeof dd);
  x = k.size() - 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == k[x]) {
      dd[s[i] - 'a'] = x;
      x--;
    }
    Dp[i] = dd[s[i] - 'a'];
  }
  for (int i = 0; i < s.size(); i++) {
    if (Dp[i] == -1 or dp[i] == -1) {
      cout << "No" << endl;
      return 0;
    }
    if (Dp[i] > dp[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
