#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int MOD = 1e9 + 7;
char A[MAXN];
char B[MAXN];
vector<int> C[26];
int R[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> A >> B;
  int N = strlen(A);
  int M = strlen(B);
  for (int i = 0; i < M; i++) {
    C[B[i] - 'a'].push_back(i);
  }
  if (B[0] != A[0]) {
    cout << "No\n";
    return 0;
  };
  if (B[M - 1] != A[N - 1]) {
    cout << "No\n";
    return 0;
  };
  R[N - 1] = M - 1;
  for (int i = N - 2; i >= 0; i--) {
    int c = A[i] - 'a';
    int k = lower_bound(C[c].begin(), C[c].end(), R[i + 1] - 1) - C[c].begin();
    if (k == (int)C[c].size()) {
      cout << "No\n";
      return 0;
    };
    R[i] = R[i + 1];
    if (C[c][k] == R[i + 1] - 1) {
      R[i]--;
    }
  }
  int lst = -1;
  for (int i = 0; i < N - 1; i++) {
    int c = A[i] - 'a';
    int k = lower_bound(C[c].begin(), C[c].end(), lst + 1) - C[c].begin();
    int t;
    if (k != (int)C[c].size() && C[c][k] == lst + 1) {
      t = ++lst;
    } else {
      if (k == 0) {
        cout << "No\n";
        return 0;
      };
      t = C[c][k - 1];
    }
    if (t + 1 < R[i + 1]) {
      cout << "No\n";
      return 0;
    };
  }
  cout << "Yes\n";
  return 0;
}
