#include <bits/stdc++.h>
using namespace std;
const int MN = 300005, inf = 1000000005, mod = 1000000007;
const long long INF = 1000000000000000005LL;
struct odp {
  int a, b, c;
};
pair<int, int> S[MN];
int T[MN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &S[i].first);
    S[i].second = i;
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &T[i]);
  sort(S + 1, S + 1 + n);
  sort(T + 1, T + 1 + n);
  vector<pair<int, int> > stos;
  vector<odp> ans;
  for (int i = 1; i <= n; ++i) {
    pair<int, int> cur = {T[i] - S[i].first, S[i].second};
    while (!stos.empty() && cur.first < 0) {
      int d = min(stos.back().first, -cur.first);
      ans.push_back({stos.back().second, cur.second, d});
      cur.first += d;
      stos.back().first -= d;
      if (stos.back().first == 0) stos.pop_back();
    }
    if (cur.first < 0) {
      printf("NO");
      return 0;
    }
    if (cur.first > 0) stos.push_back(cur);
  }
  if (stos.size()) {
    printf("NO");
  } else {
    printf("YES\n%d\n", (int)ans.size());
    for (auto a : ans) printf("%d %d %d\n", a.a, a.b, a.c);
  }
}
