#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300010;
int N;
pair<int, int> S[MAXN];
int T[MAXN];
int change[MAXN];
int incc[MAXN], iptr = 0, decc[MAXN], dptr = 0;
int ans[MAXN][3], aptr = 0;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  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 + N + 1);
  long long total = 0;
  for (int i = 1; i <= N; ++i) {
    change[i] = T[i] - S[i].first;
    total += change[i];
    if (change[i] < 0)
      decc[dptr++] = i;
    else if (change[i] > 0)
      incc[iptr++] = i;
  }
  if (total != 0) return 0 * puts("NO");
  int i = 0, j = 0;
  while (i < iptr && j < dptr) {
    int l = incc[i], r = decc[j];
    if (l > r) return 0 * puts("NO");
    int d = min(change[l], -change[r]);
    ans[aptr][0] = S[l].second, ans[aptr][1] = S[r].second, ans[aptr][2] = d;
    ++aptr;
    S[l].first += d, S[r].first -= d;
    change[l] -= d, change[r] += d;
    if (change[l] == 0) ++i;
    if (change[r] == 0) ++j;
  }
  assert(i == iptr && j == dptr);
  puts("YES");
  printf("%d\n", aptr);
  for (int i = 0; i <= aptr - 1; ++i)
    printf("%d %d %d\n", ans[i][0], ans[i][1], ans[i][2]);
  return 0;
}
