#include <bits/stdc++.h>
using namespace std;
using namespace rel_ops;
const int INF = 1000000001;
template <class T, class U>
ostream &operator,(ostream &out, const pair<T, U> &p) {
  return out, p.first, ' ', p.second;
}
template <class T>
ostream &operator,(ostream &out, const vector<T> &v) {
  for (typeof((v).begin()) i = ((v).begin()); i != (v).end(); ++i) {
    out, *i, ' ';
  }
  return out;
}
template <class T, class U>
istream &operator,(istream &in, pair<T, U> &p) {
  return in, p.first, p.second;
}
template <class T>
istream &operator,(istream &in, vector<T> &v) {
  for (typeof((v).begin()) i = ((v).begin()); i != (v).end(); ++i) {
    in, (*i);
  }
  return in;
}
template <class T>
ostream &operator,(ostream &out, const T &t) {
  return out << t;
}
template <class T>
istream &operator,(istream &in, T &t) {
  return in >> t;
}
struct Ostream {
  ostream &out;
  Ostream(ostream &_out) : out(_out) {}
  static const void *lastLine;
  struct Line {
    ostream &out;
    bool first;
    Line(ostream &_out, bool _first = false) : out(_out), first(_first) {
      lastLine = this;
    }
    ~Line() {
      if (this == lastLine) {
        out << '\n';
        lastLine = 0;
      }
    }
  };
};
const void *Ostream::lastLine = 0;
template <class T>
Ostream::Line operator,(const Ostream::Line &out, const T &t) {
  if (!out.first) {
    out.out << ' ';
  }
  out.out, t;
  return Ostream::Line(out.out);
}
template <class T>
Ostream::Line operator,(const Ostream &out, const T &t) {
  return Ostream::Line(out.out, true), t;
}
Ostream Cout(cout);
int io_init() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(9);
  return 1;
}
int _io_dummy = io_init();
const char *YN[] = {"NO", "YES"};
template <class T, class U>
bool remin(T &a, const U &b) {
  return b < a ? a = b, true : false;
}
template <class T, class U>
bool remax(T &a, const U &b) {
  return b > a ? a = b, true : false;
}
template <class T>
T fromString(const string &s) {
  T t;
  istringstream(s) >> t;
  return t;
}
template <class T>
string toString(const T &t) {
  ostringstream oss;
  oss << t;
  return oss.str();
}
struct FT {
  vector<int> t;
  FT(int n) : t(n + 1) {}
  int sum(int e) const {
    int s = 0;
    do s += t[e];
    while (e -= (e & (-e)));
    return s;
  }
  int sum(int b, int e) const { return sum(e) - (!b ? 0 : sum(b - 1)); }
  void add(int i, int v) {
    do t[i] += v;
    while (i && ((i += (i & (-i))) < ((int)(t).size())));
  }
};
int main() {
  string s, t;
  cin, s, t;
  if (((int)(t).size()) > ((int)(s).size())) {
    Cout, "No";
    exit(0);
  }
  int n = ((int)(t).size());
  vector<int> first(n), last(n);
  int p = 0;
  for (int i = 0; i < (((int)(s).size())); ++i) {
    if (s[i] == t[p]) {
      first[p] = i;
      ++p;
      if (p == n) {
        break;
      }
    }
  }
  if (p != n) {
    Cout, "No";
    exit(0);
  }
  --p;
  for (int i = (((int)(s).size()) - 1); i >= (0); --i) {
    if (s[i] == t[p]) {
      last[p] = i;
      --p;
      if (p < 0) {
        break;
      }
    }
  }
  vector<FT> ft(26, FT(((int)(s).size()) + 2));
  for (int i = 0; i < (n); ++i) {
    int c = t[i] - 'a';
    ft[c].add(first[i] + 1, 1);
    ft[c].add(last[i] + 2, -1);
  }
  for (int i = 0; i < (((int)(s).size())); ++i) {
    int c = s[i] - 'a';
    if (!ft[c].sum(i + 1)) {
      Cout, "No";
      exit(0);
    }
  }
  Cout, "Yes";
}
