#include <bits/stdc++.h>
using namespace std;
const int MAX = 200020;
const int INF = 1 << 30;
const double EPS = 1e-7;
int S, T;
int l[MAX], r[MAX];
int c[MAX][26];
char s[MAX], t[MAX];
int main() {
  ios::sync_with_stdio(false);
  cin >> (s + 1);
  cin >> (t + 1);
  S = strlen(s + 1);
  T = strlen(t + 1);
  for (int i = 1; i <= (S); ++i) {
    l[i] = l[i - 1];
    if (t[l[i - 1] + 1] == s[i]) ++l[i];
  }
  for (int i = S; i > 0; --i) {
    r[i] = r[i + 1];
    if (t[T - r[i + 1]] == s[i]) ++r[i];
  }
  for (int i = 1; i <= (T); ++i) {
    for (int j = 0; j < (26); ++j) c[i][j] = c[i - 1][j];
    ++c[i][t[i] - 'a'];
  }
  for (int i = 1; i <= (S); ++i) {
    int hi = l[i - 1] + 1;
    hi = min(hi, T);
    int lo = T - r[i + 1];
    lo = max(lo, 1);
    int k = c[hi][s[i] - 'a'] - c[lo - 1][s[i] - 'a'];
    if (k <= 0) {
      cout << "No\n";
      exit(0);
    }
  }
  cout << "Yes\n";
  exit(0);
  return 0;
}
