#include <stdio.h> int main() { int arr[100][100] = { 0 }; int i = 0, j = 0; int n = 0, sum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { scanf("%d", &arr[i][j]); } } for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (i > j) sum += arr[i][j]; } } if (sum == 0) { printf("YES\n"); } else printf("NO\n"); return 0; }