#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f *= -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
struct itn {
  int id, a;
  itn() {}
  itn(int I, int A) { id = I, a = A; }
  bool operator<(itn b) const {
    if (a != b.a)
      return a < b.a;
    else
      return id < b.id;
  }
} s[300005];
struct way {
  int i, j, d;
  way() {}
  way(int I, int J, int D) { i = I, j = J, d = D; }
};
int n = read(), t[300005];
stack<int> st;
vector<way> ans;
int main() {
  for (int i = 1; i <= n; i++) s[i] = itn(i, read());
  for (int i = 1; i <= n; i++) t[i] = read();
  sort(s + 1, s + 1 + n);
  sort(t + 1, t + 1 + n);
  for (int i = 1; i <= n; i++) {
    int u = s[i].a - t[i];
    while (!st.empty() && u > 0) {
      int j = st.top(), v = s[j].a - t[j];
      if (v < 0) {
        st.pop();
        if (-v <= u)
          s[j].a -= v, s[i].a += v, ans.push_back(way(s[j].id, s[i].id, -v));
        else
          s[j].a += u, s[i].a -= u, ans.push_back(way(s[j].id, s[i].id, u));
        if (s[j].a != t[j]) st.push(j);
      } else
        break;
      u = s[i].a - t[i];
    }
    if (s[i].a != t[i]) st.push(i);
  }
  if (st.empty()) {
    printf("YES\n%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++)
      printf("%d %d %d\n", ans[i].i, ans[i].j, ans[i].d);
  } else
    puts("NO");
  return 0;
}
