#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007, oo = 1000000009;
void Emsawy() {}
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
vector<vector<pair<int, int> > > adj;
int n, m, k, w, h;
struct Node {
  vector<int> ord;
  int cnt;
  Node() {
    ord = vector<int>(26, -1);
    cnt = 0;
  }
  void Add(vector<int>& v) { ord = v; }
};
int main() {
  Emsawy();
  string a, b;
  while (cin >> a >> b) {
    vector<Node> L(a.size()), R(a.size());
    int po = 0;
    for (int i = 0; i < a.size(); i++) {
      if (i > 0) L[i].Add(L[i - 1].ord);
      if (po < b.size() && b[po] == a[i]) {
        L[i].ord[b[po] - 'a'] = i;
        po++;
      }
      L[i].cnt = po;
    }
    po = b.size() - 1;
    for (int i = a.size() - 1; i >= 0; i--) {
      if (i < a.size() - 1) R[i].Add(R[i + 1].ord);
      if (po >= 0 && b[po] == a[i]) {
        R[i].ord[b[po] - 'a'] = i;
        po--;
      }
      R[i].cnt = b.size() - po - 1;
    }
    bool ok = 1;
    for (int i = 0; i < a.size(); i++) {
      int pl = L[i].ord[a[i] - 'a'];
      int pr = R[i].ord[a[i] - 'a'];
      if (pl == -1 && pr == -1) {
        ok = 0;
        break;
      }
      int mx = 0;
      if (pl != -1) {
        mx = max(mx, L[pl].cnt + (i + 1 < a.size() ? R[i + 1].cnt : 0));
      }
      if (pr != -1) {
        mx = max(mx, R[pr].cnt + (i - 1 >= 0 ? L[i].cnt : 0));
      }
      if (mx < b.size()) {
        ok = 0;
        break;
      }
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
