#include <bits/stdc++.h>
using namespace std;
char v[2005][2005];
int sum[2005][2005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", v[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v[i][j] == '1') {
        sum[i][j] = 1;
      }
      if (i > 0) sum[i][j] += sum[i - 1][j];
    }
  }
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int j = 0; j < m; j++) {
      int A = 0, B = 0;
      if (i > 0) {
        A += sum[i - 1][j];
      }
      B += sum[n - 1][j] - sum[i][j];
      if (A + B == 0) ok = false;
    }
    if (ok) {
      printf("YES");
      return 0;
    }
  }
  printf("NO");
  return 0;
}
