#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 30;
const double PI = M_PI;
const double EPS = 1e-15;
const int MaxN = 200005;
int L[MaxN];
int R[MaxN];
char A[MaxN];
char B[MaxN];
int T[MaxN][26];
int main() {
  cin.sync_with_stdio(false);
  cin >> (A + 1);
  cin >> (B + 1);
  int sizeA = strlen(A + 1);
  int sizeB = strlen(B + 1);
  L[0] = 0;
  R[sizeA + 1] = sizeB + 1;
  for (int i = 1; i <= sizeA; i++) {
    L[i] = L[i - 1];
    if (B[L[i] + 1] == A[i]) L[i]++;
  }
  for (int i = sizeA; i >= 1; i--) {
    R[i] = R[i + 1];
    if (B[R[i] - 1] == A[i]) R[i]--;
  }
  for (int i = 1; i <= sizeB; i++) {
    for (int j = 0; j < 26; j++) T[i][j] = T[i - 1][j];
    T[i][B[i] - 'a']++;
  }
  for (int i = 1; i <= sizeA; i++) {
    if (L[i - 1] + 1 < R[i + 1] - 1) {
      cout << "No" << endl;
      return 0;
    }
    if (L[i - 1] + 1 == R[i + 1] - 1) {
      if (B[L[i - 1] + 1] != A[i]) {
        cout << "No" << endl;
        return 0;
      }
      continue;
    }
    int lo = max(R[i + 1] - 1, 1);
    int hi = min(L[i - 1] + 1, sizeB);
    if (T[hi][A[i] - 'a'] - T[lo - 1][A[i] - 'a'] == 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
