#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &item) {
  out << '(' << item.first << ", " << item.second << ')';
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  for (const auto &item : v) out << item << ' ';
  return out;
}
const int N = 300010;
ll t[N];
pair<ll, int> s[N];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  vector<int> toLeft, toRight;
  vector<pair<pii, ll>> moves;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> s[i].first, s[i].second = i;
  for (int i = 1; i <= n; ++i) cin >> t[i];
  sort(s + 1, s + n + 1);
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; ++i)
    if (s[i].first < t[i])
      toRight.push_back(i);
    else
      toLeft.push_back(i);
  for (int i = 0, j = 0; i < toRight.size(); ++i) {
    int x = toRight[i];
    while (s[x].first < t[x]) {
      while (j < toLeft.size() && s[toLeft[j]].first == t[toLeft[j]]) ++j;
      if (j == toLeft.size()) return cout << "NO\n", 0;
      int y = toLeft[j];
      ll d = min(t[x] - s[x].first, s[y].first - t[y]);
      if (2 * d > s[y].first - s[x].first)
        return cout << "NO\n", 0;
      else
        moves.push_back({{s[x].second, s[y].second}, d}), s[x].first += d,
            s[y].first -= d;
      if (s[y].first == t[y]) ++j;
    }
  }
  for (int i = 1; i <= n; ++i)
    if (s[i].first != t[i])
      return cerr << "i"
                     ": "
                  << (i) << endl,
             cout << "NO\n", 0;
  cout << "YES\n";
  cout << moves.size() << '\n';
  for (auto item : moves)
    cout << item.first.first << ' ' << item.first.second << ' ' << item.second
         << '\n';
  return 0;
}
