#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
struct _ {
  ios_base::Init i;
  _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};
int main() {
  string s, t;
  cin >> s >> t;
  int n = s.length(), m = t.length();
  s = "*" + s + "#";
  t = "*" + t + "#";
  ;
  vector<int> pref(m + 2, -1);
  int j_ind = 0;
  for (int i = 0; i <= n + 1; i++) {
    if (s[i] == t[j_ind]) {
      pref[j_ind] = i;
      j_ind++;
    }
  }
  vector<int> suff(m + 2, 0);
  j_ind = m + 1;
  for (int i = n + 1; i >= 0; i--) {
    if (s[i] == t[j_ind]) {
      suff[j_ind] = i;
      j_ind--;
    }
  }
  if (pref[m + 1] == -1 or suff[0] == -1) {
    cout << "No";
    exit(0);
  };
  ;
  vector<vector<pair<int, int>>> v(26);
  for (int i = 1; i <= n; i++) {
    v[s[i] - 'a'].push_back({i, 0});
  };
  for (int j = 1; j <= m; j++) {
    if (v[t[j] - 'a'].empty()) {
      cout << "No";
      exit(0);
    }
    auto it = lower_bound(v[t[j] - 'a'].begin(), v[t[j] - 'a'].end(),
                          make_pair(pref[j], -1));
    (*it).second++;
    it = next(lower_bound(v[t[j] - 'a'].begin(), v[t[j] - 'a'].end(),
                          make_pair(suff[j], -1)));
    if (it != v[t[j] - 'a'].end()) (*it).second--;
  }
  vector<bool> ans(n + 2, false);
  for (int ch = 0; ch <= 25; ch++) {
    if (v[ch].empty()) continue;
    if (v[ch][0].second > 0) ans[v[ch][0].first] = true;
    for (int k = 1; k <= (int)v[ch].size() - 1; k++) {
      v[ch][k].second += v[ch][k - 1].second;
      if (v[ch][k].second > 0) ans[v[ch][k].first] = true;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] == false) {
      cout << "No";
      exit(0);
    }
  }
  cout << "Yes";
  return 0;
}
