#include <bits/stdc++.h>
using namespace std;
string s, t;
int l[200005], r[200005];
int dp[30][200005];
void gd() {
  cout << "No";
  exit(0);
}
bool check(int lr, int rl, int c) {
  return ((lr ? dp[c][lr - 1] : 0) - (rl ? dp[c][rl - 1] : 0) > 0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s >> t;
  s = '*' + s;
  int n = (int)s.size();
  int m = (int)t.size();
  for (int i = 1; i < n; ++i) {
    l[i] = l[i - 1];
    if (s[i] == t[l[i]]) ++l[i];
  }
  for (int i = n - 1; i; --i) {
    r[i] = r[i + 1];
    if (s[i] == t[m - 1 - r[i]]) ++r[i];
  }
  if (l[n - 1] != m || r[1] != m) gd();
  for (int i = 0; i < 26; ++i)
    for (int j = 0; j < m; ++j) {
      char c = i + 'a';
      dp[i][j] = (j ? dp[i][j - 1] : 0) + (t[j] == c);
    }
  for (int i = 1; i < n; ++i) {
    int rg = m - r[i];
    int lg = l[i];
    if (rg > lg || !check(lg, rg, s[i] - 'a')) gd();
  }
  cout << "Yes";
  return 0;
}
