#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool uax(T &x, T y) {
  return (y > x) ? x = y, true : false;
}
template <typename T>
inline bool uin(T &x, T y) {
  return (y < x) ? x = y, true : false;
}
void err(istream_iterator<string>) {}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> buf) {
  return os << "(" << buf.first << ": " << buf.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, vector<vector<T>> &A) {
  for (auto &B : A) os << '\n' << B;
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &A) {
  bool f = false;
  os << "{";
  for (const auto e : A) {
    if (f) os << ", ";
    os << e;
    f = true;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, set<T> &A) {
  bool f = false;
  os << "{";
  for (const auto e : A) {
    if (f) os << ", ";
    os << e;
    f = true;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, multiset<T> &A) {
  bool f = false;
  os << "{";
  for (const auto e : A) {
    if (f) os << ", ";
    os << e;
    f = true;
  }
  return os << "}";
}
template <typename K, typename V>
ostream &operator<<(ostream &os, map<K, V> &A) {
  bool f = false;
  os << "{";
  for (auto &e : A) {
    if (f) os << ", ";
    os << e;
    f = true;
  }
  return os << "}";
}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << a << endl;
  err(++it, args...);
}
template <typename T>
void kek(T ans) {
  cout << ans << endl;
  exit(0);
}
int const MOD = 1000003;
long long const INF = 1e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> s(n), t(n);
  for (int &z : s) cin >> z;
  for (int &z : t) cin >> z;
  vector<int> ids(n);
  iota((ids).begin(), (ids).end(), 0);
  sort((ids).begin(), (ids).end(), [&](int i, int j) { return s[i] < s[j]; });
  sort((t).begin(), (t).end());
  vector<int> a(n);
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    a[i] = t[i] - s[ids[i]];
    sum += a[i];
  }
  if (sum != 0) kek("NO");
  int neg = 0;
  vector<array<int, 3>> ans;
  for (int i = 0; i < n; ++i) {
    if (a[i] < 0) kek("NO");
    if (a[i] == 0) continue;
    while (a[i] > 0) {
      while (a[neg] >= 0) neg++;
      assert(neg < n);
      if (a[i] + a[neg] <= 0) {
        a[neg] += a[i];
        ans.push_back({ids[i], ids[neg], a[i]});
        break;
      }
      a[i] += a[neg];
      ans.push_back({ids[i], ids[neg], -a[neg]});
      a[neg] = 0;
    }
  }
  cout << "YES\n" << int((ans).size()) << '\n';
  for (auto [i, j, d] : ans) {
    cout << i + 1 << ' ' << j + 1 << ' ' << d << '\n';
  }
  return 0;
}
