#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const int MAXC = 26;
vector<int> occ[MAXC];
int L[MAXN];
int R[MAXN];
int N, M;
char A[MAXN];
char B[MAXN];
int search(int x, int idx) {
  vector<int>::iterator it = lower_bound(occ[x].begin(), occ[x].end(), idx);
  if (it == occ[x].end()) {
    return -1;
  }
  return *it;
}
void init(char* S, int len) {
  for (int i = 0; i < MAXC; ++i) {
    occ[i].clear();
  }
  for (int i = 0; i < len; ++i) {
    occ[S[i] - 'a'].push_back(i);
  }
}
int main() {
  cin >> A >> B;
  N = strlen(A);
  M = strlen(B);
  init(A, N);
  int cur = -1;
  for (int i = 0; i < M; ++i) {
    cur = search(B[i] - 'a', cur + 1);
    if (cur == -1) break;
    L[cur + 1] = i;
  }
  for (int i = 0; i < N; ++i) {
    L[i + 1] = max(L[i + 1], L[i]);
  }
  for (int i = 0; i < MAXC; ++i) {
    for (int k = 0; k < occ[i].size(); ++k) {
      occ[i][k] = N - occ[i][k] - 1;
    }
    reverse(occ[i].begin(), occ[i].end());
  }
  for (int i = 0; i <= N; ++i) {
    R[i] = M;
  }
  cur = -1;
  for (int i = M - 1; i >= 0; --i) {
    cur = search(B[i] - 'a', cur + 1);
    if (cur == -1) break;
    R[N - 1 - cur] = i;
  }
  for (int i = N - 1; i >= 0; --i) {
    R[i] = min(R[i], R[i + 1]);
  }
  init(B, M);
  bool good = true;
  for (int i = 0; i < N; ++i) {
    int cur = A[i] - 'a';
    vector<int>::iterator it =
        upper_bound(occ[cur].begin(), occ[cur].end(), L[i] + 1);
    if (it != occ[cur].begin()) {
      --it;
      if (R[i + 1] > *it + 1) {
        good = false;
      }
    } else {
      good = false;
    }
  }
  cout << (good ? "Yes\n" : "No\n");
  return 0;
}
