#include <bits/stdc++.h>
template <typename T>
T gcd(T a, T b) {
  return ((a % b == 0) ? b : gcd(b, a % b));
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;
namespace Problem {
using namespace std;
class Solver {
 public:
  int n;
  vector<pair<LL, int>> s;
  vector<LL> t, D;
  vector<pair<LL, int>> d;
  Solver(LL n) : n(n), s(n), t(n), D(n), d(n){};
  void solve() {
    for (int i = 0; i < n; ++i) {
      scanf("%lld", &s[i].first);
      s[i].second = i;
    }
    for (int i = 0; i < n; ++i) {
      scanf("%lld", &t[i]);
    }
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    ;
    for (int i = 0; i < n; ++i) {
      d[i].first = t[i] - s[i].first;
      d[i].second = s[i].second;
      D[d[i].second] = d[i].first;
    };
    {
      LL tmp = 0;
      for (int i = 0; i < n; ++i) {
        tmp += d[i].first;
        if (tmp < 0) {
          cout << "NO" << endl;
          return;
        }
      }
      if (tmp != 0) {
        cout << "NO" << endl;
        return;
      }
    }
    queue<int> lw, rw;
    for (int i = 0; i < n; ++i) {
      if (d[i].first < 0) lw.push(d[i].second);
      if (d[i].first > 0) rw.push(d[i].second);
    }
    vector<vector<int>> ans;
    while (!lw.empty()) {
      int a = rw.front();
      int b = lw.front();
      int tmp = min(abs(D[a]), abs(D[b]));
      ans.push_back({a + 1, b + 1, tmp});
      D[b] += tmp;
      D[a] -= tmp;
      if (D[b] == 0) lw.pop();
      if (D[a] == 0) rw.pop();
    };
    printf("YES\n");
    printf("%d\n", (int)ans.size());
    for (int i = 0; i < ans.size(); ++i) {
      printf("%d %d %d\n", ans[i][0], ans[i][1], ans[i][2]);
    }
  }
};
}  // namespace Problem
int main() {
  long long n = 0;
  std::cin >> n;
  Problem::Solver sol(n);
  sol.solve();
  return 0;
}
