QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#422566#8093. JigglypuffAfterlife#AC ✓50ms50244kbC++17898b2024-05-27 16:19:572024-05-27 16:19:57

Judging History

你现在查看的是最新测评结果

  • [2024-05-27 16:19:57]
  • 评测
  • 测评结果:AC
  • 用时:50ms
  • 内存:50244kb
  • [2024-05-27 16:19:57]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int N=3111;

int n,m;

string s[N];

int v[N][N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>s[i];
        s[i]=' '+s[i];
    }
    int ans=0;
    for(int i=1;i<n;i++)
        for(int j=1;j<m;j++)
        {
            v[i][j]=v[i-1][j]|v[i][j-1];
            if(s[i][j+1]==s[i+1][j])
            {
                if(v[i-1][j-1])
                    ans=1;
                v[i][j]=1;
            }
        }
    for(int i=1;i+1<n;i++)
        for(int j=1;j<m;j++)
            if(s[i][j+1]==s[i+1][j]&&s[i+1][j+1]==s[i+2][j])
                ans=1;
    for(int i=1;i<n;i++)
        for(int j=1;j+1<m;j++)
            if(s[i][j+1]==s[i+1][j]&&s[i+1][j+1]==s[i][j+2])
                ans=1;
    cout<<(ans?"YES":"NO")<<"\n";
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3948kb

input:

5 8
petrozav
eiiiziio
tiiiavid
riiiiois
ozavodsk

output:

YES

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

5 5
abcde
fghij
klmno
pqrst
uvwxy

output:

NO

result:

ok answer is NO

Test #3:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

2 2
ab
bc

output:

NO

result:

ok answer is NO

Test #4:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

2 3
mee
eep

output:

YES

result:

ok answer is YES

Test #5:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

2 2
aa
aa

output:

NO

result:

ok answer is NO

Test #6:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

3 2
xx
xx
xx

output:

YES

result:

ok answer is YES

Test #7:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

3 3
abc
bde
feg

output:

YES

result:

ok answer is YES

Test #8:

score: 0
Accepted
time: 43ms
memory: 49004kb

input:

3000 3000
vsvkyggumynovndcrglgrzfdeiqvznbexbptudnosgiqlwdsrlesbvafnpvckgtmcdftklahaqlyxwkbyxkoparghzmzjdxmsxxlbnycimbrdqjhljkkdkfvkruefcmmjkmcmbnnwnacwtwrofsascyfgkcmmlnxztvussviizlbjzkbkanicihthlnazqmcajaskhacixdvzucuxhuvyiwzdznxbhpoujbspnbnoiavzflunbhvkttocuqthmezgpdzqnrfevzmhwkpyrmcxevxodnxnkinqg...

output:

YES

result:

ok answer is YES

Test #9:

score: 0
Accepted
time: 44ms
memory: 48944kb

input:

3000 3000
babbabbabbaaaaaaaaaabbbbbaaababbaabbabbbabaababababbbababbbabababbaaaababbbaaaababbbbaabbbaaabababbaabbbbbaaaabbabbbbaabaababaaaabababbaaaabbabbaabbababababbbbbbbaaaababbbabbbaaaaaaaaaabbaabaababbbabababbbaaababbbaaababbbabaababbbbbabbabbbabbbbababbbaababaabbaabbababbaababbbbbbabaaaababaaa...

output:

NO

result:

ok answer is NO

Test #10:

score: 0
Accepted
time: 42ms
memory: 50060kb

input:

3000 3000
iqcscrwznuvkasgpocusytnpkdytkxjpqknvxmtciinbnzupmhwpcqkmupgtbufbpsvhlhsdaqwiqfqsejldbhxbydwufvrdhtytfctrvzvdrebxqqmyejxqjnzsuviywvdbmstdhoqggerxhstvccwowkujwwsycbyiypitzhtzoahvcgzazkpndlujjcyvluspnnprypzyuuxkctephppcdtruhzgkywsrflakcrvzydycngjozamghwqjmdfcpcpfrbvqttcrcxgiriavtjfhbifenhtlxb...

output:

NO

result:

ok answer is NO

Test #11:

score: 0
Accepted
time: 39ms
memory: 48820kb

input:

3000 3000
iqcscrwznuvkasgpocusytnpkdytkxjpqknvxmtciinbnzupmhwpcqkmupgtbufbpsvhlhsdaqwiqfqsejldbhxbydwufvrdhtytfctrvzvdrebxqqmyejxqjnzsuviywvdbmstdhoqggerxhstvccwowkujwwsycbyiypitzhtzoahvcgzazkpndlujjcyvluspnnprypzyuuxkctephppcdtruhzgkywsrflakcrvzydycngjozamghwqjmdfcpcpfrbvqttcrcxgiriavtjfhbifenhtlxb...

output:

YES

result:

ok answer is YES

Test #12:

score: 0
Accepted
time: 30ms
memory: 34976kb

input:

2000 3000
vvamovcnhaczzfsslefcqqalldggurozqfewztecjjhixavgoxyoqhgzmndglgkwboczisabbvxgoixtlvpjstcemtuymtvcvkjcqznmnecozqanfesowtyvhbvzyrbvdmeicxgyroygrydyjzzlpgzrnoslubhkladzvsivbrqbsxfwsrdvjmkuztiwlxctfizfhegcgzapjfuwveaucxyzasosettdutlnnyasaecufvkzkghllowuerjidatdgdpwepagvvgbfgqwuhyqocckepvqnpacff...

output:

NO

result:

ok answer is NO

Test #13:

score: 0
Accepted
time: 44ms
memory: 48728kb

input:

2999 3000
qsmoqllopmukqnqsosskmqmtrqkpspompssplplkukqplponqtntlupulrllmsskuoqurnnnnrmkklrqlqtskmslnlrntumpqrtqlmrmlonkpoouktktppkmssrttuoltqqmnnqlokossqpqlqknlnuuqpllkquklllnlnmspprqrntruqlotkloonunssounpusmlqpllokmnrrmnpmutnttmrsntkmktumprqrnklsqlnrsprklqunumsrprsrstlrpqplppkuoqnnkqntkoqmmpprusmkou...

output:

YES

result:

ok answer is YES

Test #14:

score: 0
Accepted
time: 35ms
memory: 48800kb

input:

3000 3000
xvvlbqjvuifyavymatyjniiimakgcfidvlgefevdpfpxbxsdsocwxhbhoxkikjifpncxexofotbreqbsejgaockhjawpnlcqjkcormofpttovxfblnfhjusfynfgacqkthtaginnnayxovyxwtbahnaajboovifcuiwusuxggenvgdrfbtmumcsussidisvhsgzcwxbtsqjgtkwtconvtnfyvjxhobnxhqhggmxycodrjjzfvbnevlqzpnqdbigumopvhufdqemvszsdxoynysfuvoyihldbnq...

output:

YES

result:

ok answer is YES

Test #15:

score: 0
Accepted
time: 31ms
memory: 48792kb

input:

3000 3000
aillgmtbvqcykwagrehnvvwgyasyvgmvmfkeawkhjgrwzghtjgrxoocizypvvotslbyprehrdlxmufeelsbqbytsmfqicxxudwnizngekyossffbvxaqsbaqiayxcyvkygmhbmbxjrjmzozewtkmzwnkebqfztviyyvvbjqacdqpxdkfxrfdvbddxdksnapxanfdlpqbuelpobxnzbclbrvgblkiexevycwxvabfkxpfroboecduhcmgvotufxaygghlkcovierwiborckezhslbajwzvwclhm...

output:

NO

result:

ok answer is NO

Test #16:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

2 3000
yixmowsvvzyfddyzlprbhttgwseolhsbconvnqwtmzanoxzgrvarmgqkbbhrkjcvqknpuuknvggwaxuyllztafelxfnmgwhkuixngrgbgaqvpsinbinmcrfnjaacyqlilfcgtlkrxpfoqpxxcgrljzmlhcmgvzwzhjdxdzekjdehyexqomkkveottlwclgsmgvdmueaolcstlpgrgtaxmedjvbscfozchjjynhbnsaivulbjwnwvwamyrqlztctfqvslmtnbmjmxwqcwqufbyqjhugaawrbblpaqd...

output:

YES

result:

ok answer is YES

Test #17:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

2 3000
xhxyfdoiawonuggcdpyvdewrbphpvzgfqnvxhzmqgsattgfsrobswfqcdqxlhvpcsqzshxbkqclxoyxcplpobuabwlrouooltrcktjeidmulnsiymycwosyjaaymsfpoxnvyxrshvpbzijaumihrbxkmjlfwnritudrmfhjrpywohivgoxjdbjumcwkfimfokeyzozifuruxrprgsehcefprxffsdofbeeufwhgfdobrwcrmckbvsichfdlewmzaiaadfmcbrrxsektlprhzjczsqxsotasjncwnn...

output:

NO

result:

ok answer is NO

Test #18:

score: 0
Accepted
time: 0ms
memory: 15720kb

input:

3000 2
jn
nv
mr
xk
xv
qt
bp
cf
nz
wa
xt
ow
eo
sz
iq
hz
su
zt
uq
cx
nc
xj
bq
dk
jh
qa
gl
kq
rw
es
pq
pk
if
to
ui
bu
yp
ak
wa
es
kl
cf
ga
ja
cq
vx
mh
cc
bp
el
pt
cy
it
bp
uo
ia
rg
nj
be
oi
ho
qx
fb
ty
hu
df
aj
rr
wn
rx
mn
gf
wj
cx
eu
wt
md
gq
me
vb
rl
om
zy
gz
vn
xs
dj
tx
bd
aj
az
pf
gt
xl
xp
jq
kq
gk...

output:

NO

result:

ok answer is NO

Test #19:

score: 0
Accepted
time: 36ms
memory: 48900kb

input:

3000 3000
wihawrztpspghfcntppyomzikpievciljnyybmndefjznqlnfclmgucqlprelwnckaqaizxxtyigwqyfkiydbvgmebouijwxhchcohrqvdwikqfxzfzxdcdioggpdijypkuligveixhjkwbkqalsttecfykrlpzjetasrswzkrjhafqmyrmjumiqvcofnpjjdwwjhjbgvvmhzlmjtijgdznvcesyycxohyspprkxvyjuuqsdkuizudnoysbcdfllcxqnnhmichgtmpzaxqsnfkdanzowqiskok...

output:

YES

result:

ok answer is YES

Test #20:

score: 0
Accepted
time: 35ms
memory: 48744kb

input:

3000 3000
bmnhdypoeopgbjzqfuhugmofebudcohjmxrnzubnldlrgjfbtlykkgnkuyfktpyfpevgafqhsougvfmlkirufbynllknaqxcltfuwcizrzznojlfsfjkhqyiuxhlylegjhwdbksgxxrqhslvukdykxdrgidaroecaqmwrijzxqcwvaagcrorutyyqoxyyfpzhapygsoxiuufaivjgspplvgmzhjzyhgdzsoaixtcpriztjkbnzxkvutwwrfltqyhyswndvwldvzlgdjvmrthkhgqbrwnztnrja...

output:

YES

result:

ok answer is YES

Test #21:

score: 0
Accepted
time: 38ms
memory: 48788kb

input:

3000 3000
prppsqqsrqqptsptssrrstrtrpttssrqqpssrtqqssqssstsqtqqsqptpptppqsrstrtqqptstqqssrsssstpqrprttrttrstqtrqtrrtspqtqpqqrspqtpprsrrrrqppqpqsstrstqstptqqttqtrpsppssrrppqsqqsrtpqptrqptprprsspprptsqpqpsrtssqstrrsstspsqssptqptpspssrpsqsqssrspqrqrtrqpstqrqttpprtttqstrttqtrprsqrpqsqqsqqrprqrqsptrttsqrs...

output:

NO

result:

ok answer is NO

Test #22:

score: 0
Accepted
time: 31ms
memory: 48748kb

input:

3000 3000
uvvuvuuuvvwwvvvuwvvuwwuvvuvwwvwwuwwwvuwuwwvvwwuuvvwvvuuvwuwvwuvwvwuvuvuvuuwvwvvuwvwvwwuvwuwvvwwwuuwvuvwuwuuwuwwuvwuuuvwvuvwvuwuwwwvvwwuwvwvvuuuuuvwwvvvwvuwuwwuvwwuwvvuuuwvvuwwuwwvuwuwwvwvvvwuuvuuvvuwvvwuuuvvwvvvuvvuvvvwuwuuwvwuuwvvwuuvuwuvuuwuvwuwwuwwvvwwuuwvuwuvwuvwwwuuvvvwwvwuvuuuuuuwvwu...

output:

YES

result:

ok answer is YES

Test #23:

score: 0
Accepted
time: 31ms
memory: 48736kb

input:

3000 3000
uuuwwuuwvvuwuwuvvwvwuuvwwwuwwwuuwvvwwvwwvvuuwuvwwuwvvuvuwvuuwwuwuwuvwvwuuuvvvuwvuwuwvvwwwuvuvwuwvvwuuwuwuuvwuwwwwvuvuvvwvwuuuvwwuvwvvuwuvwvvvvwvuuvvvvuwuwuuvuvvwuvwwuuwuuwwvvuwwuuvuuuuvuvvwvuuwuuuvwuvvvvwvvwuvvuwvuwwvwuwuvvwvuvuwuuwuwwwvwwuvuwwwwvuuwwuuuwuuuwuvuuvvwwwuuwwuvvwvwwuvvuuuvwuww...

output:

YES

result:

ok answer is YES

Test #24:

score: 0
Accepted
time: 40ms
memory: 48732kb

input:

3000 3000
wwvuwvuvwuvvuvwvuvuuvuvwvuvuvuvuvvvvvwvuvvvvuwvwvuvvwuuuuuwuuuuwwwwwwwvwwwuwvuvuwuuwuuwuwvvwvvuvuwvvwwwuuuvwuwwuuuwuvuvvwwvuuuvuvvwvuvwuwvwvuuvwwvuuuvvwvwuvuwwuuvvuuuwvwvvwvvwuwvvvuvuuuvvuvuvuuvvuuwvvuwvvvwwuvvuwvwwvvwwvvuvwvwwwvwvuwuwvwwuwwvvuvwvwuvvvvuvuvwuvuwuvuwwuuuuvuuuvuwvvwwvvuvvwvv...

output:

YES

result:

ok answer is YES

Test #25:

score: 0
Accepted
time: 27ms
memory: 48876kb

input:

2995 3000
ajaiackicdkfehjdkjfbejcgcdadhigccjabgfhfhhchccdjckcibickddibhhacaefhgibfdfffjeahfhcchbjbbghhcjgdjibhacbkhkcaijjfikdjfkegdhekddceckdejdaffcbaeebkdijgjjgifbjaakcffaeagcifkceekdbfaaejgicdebjhfabchgfjagdbghjhikeakdihggcbgdeiebjbackjgdkgcjkdjgiifdjgddgjbdbkhkckeacgbdheggacfidgjbiffdjbiejbjbaeie...

output:

NO

result:

ok answer is NO

Test #26:

score: 0
Accepted
time: 47ms
memory: 48664kb

input:

2995 3000
ieccbdidbfjjkgigjfibkjckdddiabhkdkdkefhhkbbgfibaehbbdkgbacefjekcakfejkfkdbeedkgaghkbdfcbhdhaedckjibhhfjhiebcijbffcdiddgjggbahaibcbdbafhgihccfagbfcfhejacjggkchaifiiahbdekgbidfhcjichhejhaifkjdgdgeaffbdabkhddaiaehjkjacagehbgegdchgdiadbfbfcgkifacigehgekdcjihbbgdcaghkbgihkifihjibgjjbbhegbbabhkg...

output:

NO

result:

ok answer is NO

Test #27:

score: 0
Accepted
time: 27ms
memory: 49496kb

input:

3000 2951
hdjeaddafchjfhgakcahacibackakiiieihdeffbcdejijcdfagjbcfhhhjjbgfkhcegfjjafahacckdadiddfigigdhdbjefakkdbbcdjeeahjehkikhiagdeedbajfkkegbehbbacjjggcegfcegbggkiadigdbicdedjkbcfcfjcakhhgccajaeeghkghgbihgefjbacefefahdcgkehbjfhagfkakkebabiahfiggkebcabadbbggddhejkffhidfjgggeeegjigkkjbhbfgjfejjeidaa...

output:

NO

result:

ok answer is NO

Test #28:

score: 0
Accepted
time: 28ms
memory: 49396kb

input:

3000 2951
hbedbakgdcihekigibfiaecfedgkjaiheiifheeeicgaeieffdgfajkieeijgjcchhidahgfbgaabkiifhhjdckicckjfajjjijkgbfcdbekegiaababhfcikjddbaghbffbffjbjgcjdchiccifjejidicakbgekdaejacfeibadfakedjcjkfefjfgdfcbbbhbiebfdecjigicbdegbgabbchcjbefidkfcgfiaffbghdcijiafcahecejhkfbabedgeaadifeccijdaiahhfkigjkckfhgk...

output:

NO

result:

ok answer is NO

Test #29:

score: 0
Accepted
time: 24ms
memory: 49496kb

input:

3000 2951
egdhcgbjbjdidjkejjkfjiaaggdgbadhbbddibkdfagfjaicecheheidahfihjkebiggbchibkdhhkhaekfgkffkjfkdegbdbbbcbjacigkdafegcakjaekchekiajeaaagciekjjdijjadjhdekhddchcbefkifhkhghgghcdebjcafkeddidkgcikdiigdiidfffcefjjhjjbjkiiidfhfbbjadhjekgeefjgdjcbefaefggfkfekehbdbihhhihkaigjckbfgejicfafcfjgahjgceecegf...

output:

NO

result:

ok answer is NO

Test #30:

score: 0
Accepted
time: 33ms
memory: 48784kb

input:

3000 3000
kjllchqnyfcuwvfkoappzhjcuatedfcdrpxnrwirnxotsyzuaddtuncjrltvuqbvhfnngjjwppwycuxqptvrrriyzjzpsubgectllyphfprgkxxpiybtxccqiwysplcfgiwwfsuxtvkldmqgnksmiqpaoykkvvrbrtwitohjseszwskjcnaynowttcefjvyutazsotntqxruodvvfsshnjlfiddrpnrsyiwkrjwbcwrwwxwwvimdljwpxppwokoyxppakunkttldmekvcrequbgrkumcffyzcj...

output:

NO

result:

ok answer is NO

Test #31:

score: 0
Accepted
time: 28ms
memory: 48716kb

input:

3000 3000
kezcysvdvaahmxirkyucmzpykywyqlospawpqacssctmbvmecpejxveezhhzarudbxlolldwfypvqwetuyvrqifrrotchzhndjwvwoxacxynjobnuvdckimdukxxoryczorolaoufjnprjmmjlfoglxhemfveckhefzttgqiqjzrkujrkspmnxokhjavcetghtjcelyhmossnfujhjkhchlltzovdyhzecfumrmprhqbjwtbrjeglfdeidleefdlirzgspucmhicpdvnyfexhcedhxalkuccvn...

output:

NO

result:

ok answer is NO

Test #32:

score: 0
Accepted
time: 37ms
memory: 48820kb

input:

3000 3000
qrpqqpqrqpprpprqppqqppqpqrrqrrqrppppqpppprrpprpqqrrrqrrrprqpqrrrpprpqrqpqqqqqqpprrpqqpqpqqpprprpqpppqqqprrpqrqqprrqqqpprrpqrrqpqrqpqrrrqppprrrqrpqprrqqpqppqppprrpprqrqrrpqpprrqqrrppqprrrrqpprpprrrrqpprprqqprrpqqrrqpqrqqqprrrqrrrqqpqrrqqprrpqrppqpppqqqrpqppprqqrprrppppqprqqrpppqpqprrprrprrr...

output:

YES

result:

ok answer is YES

Test #33:

score: 0
Accepted
time: 42ms
memory: 48792kb

input:

3000 3000
rqrpppprqrpqqrqrqprprqqqqqpppprrprqqprpqrqqpqrprpprqrqrqpprqppppqrrpqqqqqpprrqpqrqrqrrrprrqprrqpprrpqppqprrppprrqpqrprqrrrpqrqrrpppprrqpprrprprrrqprrrqpprrrpqprrppqqqqppprpqqqrqrqrpqqprpqpqprqrqrpqrrprrqrrrpqpprqqqprrqppqpprpqqrrpqpqqqqpqrpqqrqrpqpqprrrprqqrqqqrrqqpqrqqprppqrprqqpqqpqpqppq...

output:

YES

result:

ok answer is YES

Test #34:

score: 0
Accepted
time: 31ms
memory: 48772kb

input:

3000 3000
pmjssxtefenbdmdiucypzzkuoprhupxihtobwwbygqruhsgyxibmzfnvgnlujuqeytglyidylygmvrdbdbfvfqxnekruxkkkxtfneovsncragyefpvuluvljrvqolurivywggwlxqkkdwhkatidipijdkuledxqpzmotpcrnvsiqupbnlowzstvyohkrzokjdljvzpnpxzqenvtitjzyifukpnuvnipomimscfyambumwnfcuziwfjuysvijvwgytusyivyupxdjalpjmtoofxfioanwjhuthj...

output:

NO

result:

ok answer is NO

Test #35:

score: 0
Accepted
time: 22ms
memory: 48952kb

input:

3000 3000
azwepfzvjecuofchtlaiifoiurhgemjgdqhczebzahevkxaijwleovguznxgeightxjfyogypznomosxmwaubdpzacccphdryyutrpxsvznnkmknlpnovmlgdrvttewbjbfcybusdjhnkocwtphiquypxgodsauqavsrsxuzoxjysrhvhstghdbzxxnamlxvvcwoxlnrzizocwadvxbdclfowzrsxoiifbbxfovvtemgksqkzyzgemevugwxecwzsvjwlhwatmrcxvlhuvehlskfranysbrzew...

output:

NO

result:

ok answer is NO

Test #36:

score: 0
Accepted
time: 38ms
memory: 50244kb

input:

3000 3000
rdbxyedthdqwqwldbzfxjelbhhydwxbxgtmbkzstjsstxymstqooaatqqdqhadsheepqyhdsajuujurncbizitxvhdnwadsspxntysntroalobxrntwotofwbufxujpvoenqzhxlxskexwgazbwmmgifgctmwrjnhlktzgnhbzmznvghruvdnypwjvhhyerlpfharjufyhlqidipqkzxzsondjpvlxframwddpakbfjmzhfmrqsvtzfgmfpqhwsonhglpqqbltipyilzjybhzgrbnbjqhflnqt...

output:

NO

result:

ok answer is NO

Test #37:

score: 0
Accepted
time: 44ms
memory: 48952kb

input:

3000 3000
dfdnfhyyermajmzozsflpagnpvpktljceeltvgdazxkbgviukxgkjdyzkggifosqzwifqdqjunocyprapbdtjehyfftjwahzbqzlrvjbgjpfxliqoofiiwixmajodwcrrwsmmgcucjxhmuvnxmfftqgyhzivoiuoaewlmdcdxrndmxoujlyaezpwkyajmxrwyutummvkldhdjrdbuoqxeaagwxggadosrclzsczlthffupfuymormgpcesujsvjnfcfordudziqamsquprovesoalxlplldhja...

output:

NO

result:

ok answer is NO

Test #38:

score: 0
Accepted
time: 36ms
memory: 48792kb

input:

3000 3000
egzsiitxoyxbvrzsnopgqhhhxizsfizkocxyqdroqzkqbnltaehvxrxwzneokhxdiouiciyjtzluexfppmikbormsgafyyawzhsiymfjsoztimlkymfzafmwltfwomtnkosiqexsafcptnwriauxkjcfvjbnahvqisynunqhoxwvvlprfjngpsjixisihwrenccayynxaoampdlvesdkdnunrhelnlhepijxqmmywlnjvnnivfqwknlgzxokwcjbxdqvojhzzqrkckhoxblobzbeiecavbcvav...

output:

YES

result:

ok answer is YES

Test #39:

score: 0
Accepted
time: 46ms
memory: 47896kb

input:

2937 2989
jpejljtksenmbjvrfirvdxidsrlduztytgisbajzdesfcrxmzbocwlhhispnpcdfplesyamjuqacgumotwhqobdixoigkerljmniraisgmobiysqaskmqoikfjzrorvkmklvfwjgfivrrzygwhxvuvqooobivgqwmocxfwdawdttqgclhcncfrkunkpggnsafjcratjydjhooncxifjcltmqcrjstkpmlgjipkuyhzhukjemxjfbbfuuombcohwyvfzilzurkcdxlajcptortuimjoyloacjvn...

output:

YES

result:

ok answer is YES

Test #40:

score: 0
Accepted
time: 50ms
memory: 49708kb

input:

2999 2999
wmttsofzpwrtipbircfhmmhifjqvttgscbblxayffyswykszxogeerghkhpatchjyovaccxxxrxwiswmxbmzxbwxkqgogsmztexdljibilazouuaztswgyitltzwbwysmkiwlzmmtnjjpxxcojoypjpjonsywktctfsdkqqnuxnfijxydtcgqongcbrarhmmvcgmawzgygywmfplgoyqpkybxcvtjdidjobyjjieyawcnplxgwyymxoiabijabtyxyskhdlkjubulfrmwowxipwtyfuvoouvuh...

output:

YES

result:

ok answer is YES

Test #41:

score: 0
Accepted
time: 40ms
memory: 47240kb

input:

3000 2501
riyznpwojfowfpilfbievevihjmdghbnfdmfddatkjtozzmlzovweixdammzjcmgjcukroakdahapdljgwcepdryqezvpzvfmajvgyvjxwnvacxolzbjgkvukcunqisdrgdblntjkyyetwmesxiqsfddytsjzmwoilyvjdavzfkjlmldpdgrcfhezdcgtfdmoiekpnxfsiopgimlcwmilxdbdfpchprwybrsznnnlclttcwdzcmvnxkszqhppbdeuuvcfjklynztuvlyschivrozqlodheswaj...

output:

YES

result:

ok answer is YES

Test #42:

score: 0
Accepted
time: 23ms
memory: 48900kb

input:

3000 3000
zpyvbrqshgbqjwrtsietydzgxxzcencfbsiywkqtwulfvhljvnqaijfrjtomksxcfbrzrkjnpedybrfzxtfownliqmeeekjidplxmjdcxdwscankmlejhaxynogughiptgnmngsncdbmlobpctswbsgclrluknlstfqfbdaauuzuztvdaisnepsoesxjsydevbffvlclnftrjcdwxafweslbmuslyxwoabnmrcikpmxxfqbnrvplhpegvmxawlzbphvuiaxyyhmmtosznvdyqgjmbrlqpqtpxv...

output:

YES

result:

ok answer is YES

Test #43:

score: 0
Accepted
time: 39ms
memory: 48732kb

input:

3000 3000
zrvieqkrdwgxmuzovyaxcwwivzfcjyykirtpuoenktvrpqgzwaeamawhivercklczqorhcrsfbvzwfcwjazplpxmeqvgtrjikajzgwpymkpcsyeuaeextqvghyxftyqnokiurfzuxexjzemjuraslwqdbxivpvyjrsaglpnzlhscmrrxdptqpcwvtzmxetdibiysjpofuvjjeflfpksqybdsfyytqtttqdbrtqiaaqrnhjpjciybtbiuzskzgqqlyjodmpknwofhswnbpggjpjbburxchfdysh...

output:

YES

result:

ok answer is YES

Test #44:

score: 0
Accepted
time: 34ms
memory: 49596kb

input:

3000 2999
pqgwozqsjfzraupogdpnujdrqpkgaphvfvaypjrptvpsgxluqtsgojlkrefcfqroarvoapgngcfxemkfiagbkkngtfojlcjhghlpfvclxqgcrtkosrywgvhghkpdhwljyxbmnezaoehoextrvwooeyywzkommyzacqptzrjjvhrstfwsxctywqeurbmjnrgiahujbtupbvcbmiyickdaytenmkasgbwnlghzmtmywlfjybxybiegyaubkpwelhctfwatfuwacqdybrcwkvzvkjxbefvmvxjges...

output:

YES

result:

ok answer is YES

Test #45:

score: 0
Accepted
time: 26ms
memory: 48940kb

input:

3000 3000
zaetjczdkelbogaajruzghfhtfjgtsstlrlvbfewsnxwvdnbdhwrjkcbivxizxtgoqvqwssmsmasryiijnmnozenfixuctfefswrnmbtxrgosglxnamnlyztpbklfpjosgnqmoiqbddeubparvdvrxuwblyfuspvoannczcutxakuvjbmcvcimuliifgqomirzglxflvcaoesknsceoehfhaywcxnhmkhdhmujqgnlbvzpqandidflmmochonybbduqljcrtcwxsftyicakjsmceygiquvnkxn...

output:

YES

result:

ok answer is YES

Test #46:

score: 0
Accepted
time: 41ms
memory: 48776kb

input:

2997 3000
pkmlqkzvpybuynmpdyiagddutogjpttkccwqvczulrebkevxbqisqxxrynzdyykqachlzjuesxreoekaoeouqfyeeibwjyqjcyvroghebbieanydmdogcdcasggspajgxhqevjkinpjdjcknmvlqcalutgybgyayzixesrcmeidlnrmibdtkjvpgelqrulmhhdyavzgllbsunxerthsbagnugmahxfkaamtiqxpslbnhhwwgzbcuirlhhoapohpihquphnqxcmcffnpziyfjjiygyqcdgrhhea...

output:

YES

result:

ok answer is YES

Test #47:

score: 0
Accepted
time: 34ms
memory: 48956kb

input:

3000 3000
ywstrsxzhvwcgmhkjoqhoivrgbafaernptnakevyapagvzwrhbdqryxwhdnsjjcwawgrqtfczpjwpjazejgbhdynxetkrovsugxafrruvpjvmyhusgzcttergldwukfmnyvpejinbmjrybnyvtgzjvycuoimitiuyiyrwusyhzpdsuisrhrqhuodykrfvjidhnfowzoqtombipieaxncwnjbjqnlrpnmwkugxsilyuczeudtbjonlezqeofovlzfkfidiyaorekzdwvovnwtcxjdhxelpzotwb...

output:

YES

result:

ok answer is YES

Test #48:

score: 0
Accepted
time: 29ms
memory: 49524kb

input:

3000 3000
jsnowgidktxqymmjznjkgdztohktspeajlmyziiakprjlufgffycormlmremozqwrhfezcdiybokgsvaugolbdfwaslhaexoptckdhfbebmepkuitvadxpkxyxlhmasgyaajzyndkywaagpvwcojayyalhbxwneozpzrpheuevcuqncrypwtqblkdrlfdpblsvxuntuyupteuznqohwenetawfogjwaqwsmdjgkvebwrxtohkkimcwwsfahuwqaqicioqfttwuflehnftaahxdwyzeepeiyrmu...

output:

YES

result:

ok answer is YES

Test #49:

score: 0
Accepted
time: 34ms
memory: 48888kb

input:

3000 3000
lhysftitcnticgzvpjbrenkniobpfmvbxciprojaibdjpedtwftzyjuztfvffpjdyjaxqianywroapajgugulklfzjnqoxczruaayijrhcehhlhgfkaauoebqavzmiprrrjqtsebpvonmkwndlpjijeusskmyccucxdfakljgirwwfytvqinxkdhpofnfefkzymnizogvhwqhpmkigqyctghiwewvtfiuebybikuyclboajlktxawlbhrqhnxfzdarqydhveasqviwpkgpzbkjpwvscghflmjb...

output:

YES

result:

ok answer is YES

Test #50:

score: 0
Accepted
time: 46ms
memory: 49928kb

input:

3000 3000
byxwfgigimqxzmzjpdfxyeimejvtwmklyspcpicgmefwzazugroacvbwyuegmcruuwzrcbxkjuobbhpznwpxomhbrmayiqblqahzfuysvpxciudylhxerozurduskeojndwycvhdoqmhgqptwmtqvvdjogfdnqffnwgddqcspekbzwlwyhkfwztjseascixcplxeibpnxdvplayuupmcxrcfeusxxrumqhylwzqxhibvbagmpqeqzfhurkwhoumsalqukbwmhtzymyqyhmikqtgxlwjiifpvnt...

output:

NO

result:

ok answer is NO

Test #51:

score: 0
Accepted
time: 30ms
memory: 48720kb

input:

3000 3000
byxwfgigimqxzmzjpdfxyeimejvtwmklyspcpicgmefwzazugroacvbwyuegmcruuwzrcbxkjuobbhpznwpxomhbrmayiqblqahzfuysvpxciudylhxerozurduskeojndwycvhdoqmhgqptwmtqvvdjogfdnqffnwgddqcspekbzwlwyhkfwztjseascixcplxeibpnxdvplayuupmcxrcfeusxxrumqhylwzqxhibvbagmpqeqzfhurkwhoumsalqukbwmhtzymyqyhmikqtgxlwjiifpvnt...

output:

YES

result:

ok answer is YES

Test #52:

score: 0
Accepted
time: 46ms
memory: 48912kb

input:

3000 3000
xgcldjbsrvlrnluzqdpheyuhmqlcxjgomhnisnsdcjtnqcwgyiysekomhvjnitokbtsvcoeqizbnkfmrzdhcaenhjcplfuwschkxqjwwpqjshzoxkqmtpnrrspmozwdnfxabrvnpgwwlevinyconlgkcnspzpwmcsfcjovsxjvjrmvyyxakahmcoohartdtfqvplakicmgcfgnpooaqeejkopsygcemenkwdtrvpkiryeivlgxrzcqgtzwaulbxdtmualsytnbnnvfunbrftsxjxyrouwsmhxw...

output:

NO

result:

ok answer is NO

Test #53:

score: 0
Accepted
time: 15ms
memory: 49892kb

input:

3000 3000
xgcldjbsrvlrnluzqdpheyuhmqlcxjgomhnisnsdcjtnqcwgyiysekomhvjnitokbtsvcoeqizbnkfmrzdhcaenhjcplfuwschkxqjwwpqjshzoxkqmtpnrrspmozwdnfxabrvnpgwwlevinyconlgkcnspzpwmcsfcjovsxjvjrmvyyxakahmcoohartdtfqvplakicmgcfgnpooaqeejkopsygcemenkwdtrvpkiryeivlgxrzcqgtzwaulbxdtmualsytnbnnvfunbrftsxjxyrouwsmhxw...

output:

YES

result:

ok answer is YES

Test #54:

score: 0
Accepted
time: 33ms
memory: 48720kb

input:

3000 3000
wlxrlrhwbhixwsykyjezvhbinxibcdfvvcyrfrsdrfdltmmtyxngwkjvaxfaxyrjspfaelcvimthbjnltzcfrqqhlfgpysxxcvnlecafotabjrjvznrdmritxoyrzxrgpxjpeismiphsgmwzkikiacphvksvvnzauunmgrfktrepqkvntjmrfzpqpmbfwvjmlhxtqzdbhrbavgfmbrvzzlnzxfzuadrmkmmgnkscxcbwpqkhijxrdczlevugarpqpnhjhrpbjtlfdehkcvxmcuovldfzzsivsb...

output:

NO

result:

ok answer is NO

Test #55:

score: 0
Accepted
time: 46ms
memory: 48736kb

input:

3000 3000
wlxrlrhwbhixwsykyjezvhbinxibcdfvvcyrfrsdrfdltmmtyxngwkjvaxfaxyrjspfaelcvimthbjnltzcfrqqhlfgpysxxcvnlecafotabjrjvznrdmritxoyrzxrgpxjpeismiphsgmwzkikiacphvksvvnzauunmgrfktrepqkvntjmrfzpqpmbfwvjmlhxtqzdbhrbavgfmbrvzzlnzxfzuadrmkmmgnkscxcbwpqkhijxrdczlevugarpqpnhjhrpbjtlfdehkcvxmcuovldfzzsivsb...

output:

YES

result:

ok answer is YES

Test #56:

score: 0
Accepted
time: 47ms
memory: 48992kb

input:

3000 3000
ftjsvshffeywkrkcugfadjpvhglcvtjtfmqrbddbihyarfckwiegrtrilddanrhzkoaswnnfibotgytwlebyguzpihjwyqvkdsgibjgdbeucjbgujbhrtegerndtzxesmtadtnbeabwaxydmdlnlboyhoggakjnzafmneerzxgohedsknqlpvovjianffhsivcdppsnfcncudsixsnreluscviyrjgjfpfslcspvduerxkibspgagsxbrmfzpqcoceenmuvgsbvpbzeogyjuenwmauluceoycy...

output:

NO

result:

ok answer is NO

Test #57:

score: 0
Accepted
time: 23ms
memory: 48732kb

input:

3000 3000
ftjsvshffeywkrkcugfadjpvhglcvtjtfmqrbddbihyarfckwiegrtrilddanrhzkoaswnnfibotgytwlebyguzpihjwyqvkdsgibjgdbeucjbgujbhrtegerndtzxesmtadtnbeabwaxydmdlnlboyhoggakjnzafmneerzxgohedsknqlpvovjianffhsivcdppsnfcncudsixsnreluscviyrjgjfpfslcspvduerxkibspgagsxbrmfzpqcoceenmuvgsbvpbzeogyjuenwmauluceoycy...

output:

YES

result:

ok answer is YES

Test #58:

score: 0
Accepted
time: 38ms
memory: 50040kb

input:

3000 3000
tshyqfxnbhmbiqoahpfuytvuppllyylqawqmbaneghbqhsmrifeoxqpferjzsywgilmsutwagclmtktbjrhmsypfkcznqbecpzqupqiaxuoxevepcvhfhhvjdukractztqxvaoyyqadntxltpjxauxhsshdxjvqmfbgugflreumgayzynpattqvomhlrwmfpmbzvfsfidilsowwtjjgcoydktjvsvtjzirbeerprffzkdlwfvxfxbimtpkowazeadwwmcedgfqwofabhynhqinaujspuskqiia...

output:

NO

result:

ok answer is NO

Test #59:

score: 0
Accepted
time: 35ms
memory: 49112kb

input:

3000 3000
tshyqfxnbhmbiqoahpfuytvuppllyylqawqmbaneghbqhsmrifeoxqpferjzsywgilmsutwagclmtktbjrhmsypfkcznqbecpzqupqiaxuoxevepcvhfhhvjdukractztqxvaoyyqadntxltpjxauxhsshdxjvqmfbgugflreumgayzynpattqvomhlrwmfpmbzvfsfidilsowwtjjgcoydktjvsvtjzirbeerprffzkdlwfvxfxbimtpkowazeadwwmcedgfqwofabhynhqinaujspuskqiia...

output:

YES

result:

ok answer is YES

Test #60:

score: 0
Accepted
time: 23ms
memory: 49116kb

input:

3000 3000
vfiqgvucgauhavlilgznjylvlvqbbvlbbwqaemjpjmishlxcrpjczkzadimbykjufzzkmvljujfwsvzlldjifgxojgwfpnxraeuvhdnwrdgkvgneysebukjbxjrmlplhedcvgdanvnaasynkgeijcgphrwnhsvfzbuyksyccqxxuhdudivktmtekhlcirpisulqzgfkhyqhlvszbwpfgzfuvltnddeappsnfavanomzicxupaxmyjwpmmavpyitookhulsyckmjpkacxooqlnxgjgvignazzuf...

output:

YES

result:

ok answer is YES

Test #61:

score: 0
Accepted
time: 25ms
memory: 48744kb

input:

2999 3000
acbaaccddefefdfcfdcfddbffbacddbeaaebdaaaffccfbabaaffaadbbffdbcbdfbbaaecdfeadcbeebfaeffffdfdfcaeaefedcefeedfceecfecffcbdfbebbebceeadbcacaafefccadefdcdecabedccdedaeefeecfcaecfdccbfdcdfaedbbfbbaddcbeabaefcfabfdcbbdefdadabfdbcdeeeabdfbdbcddcaebcaffeccdcdfedfeaadcaccaceccdfcfeaafacdbedaffcabceb...

output:

YES

result:

ok answer is YES

Test #62:

score: 0
Accepted
time: 47ms
memory: 48768kb

input:

3000 3000
yxyyyzyzzyxyyyxxzzxzzyxyxxxyyyyzzxyzxyzzxxzzzxzzxxxxyzzyzyzyyyxyzyyzxzyyxyzyxyxzxxxyyyyyzzyzzxyyxzyxzxxyxyyxxxyyzxzxxxzyxyyzyxzzzzyxxyzxyxxxyyyxyyyyxzxzxxzzzzxyyzzyyyzyzzxzyyzzxzzxxzxzzyzyxxzzzzyxyyzxyzzxzxxzxyzyzyxxzyyyzxxzxxzyzzyzxxxzyxzzxyyzyyxzyxyxyyzxxzyyyyxyzxyyxyyxxxzxzxxzxyyxzxxzzx...

output:

YES

result:

ok answer is YES

Test #63:

score: 0
Accepted
time: 32ms
memory: 49320kb

input:

3000 3000
cbcccacaaaabbbbcbbaabacbbabaacababcccaabbbcbcabbbaaacaccabcbcbcbccbcacaabcacccabccbaacabaacacbccabababbccabaacacabcacbaaaccbcabbcccccbaccaccaccbbbabacccaccbbbbabcabcbbbacbaabbcababbcccaabacbbbacbaabbbcbcaaaccbcbbcbaacbbacacccbabaacacbacacbbcbccbaaacbcaccbcbbccbaaabacbcbcbaccaaacabbabbbbcbb...

output:

YES

result:

ok answer is YES

Test #64:

score: 0
Accepted
time: 27ms
memory: 48764kb

input:

3000 3000
yyyxzzyzzzxyxyzyyzxyxyyxzzzxzxyxyzyzyxxxzzxzzyyzyyxxxzyyzzxxxxzyzxxzzyyxyxxxxyzyzyzyyzzxzxxzzyyxxxzzyyyxzxxxxxxzxyxzxyxxxyyxxxyyxxyzxyyzzyyzxzzyyzyxzzzzzyzxzyxyyxyzzxxxzzxxyyyyxyxyzyxyxxyxxyyzzzxzzxxxzyzyxzzxyxyzzyxyxzzyxzzyyyxxyxxyyyxxxxxxxyyzyzyzzxzzxxxyyzyyyxxxxyyyzzzzxyyzxzzzyzyxyyyyyz...

output:

YES

result:

ok answer is YES

Test #65:

score: 0
Accepted
time: 37ms
memory: 48976kb

input:

3000 3000
rqppooorqoporqrppqpporqororrqpqqoroooorqqroorpoqqorqoqrrrqoorqqrqqpopopqppoorqqpqoorpproporrrqrqqoqrorrrroropqpooprrrqporooqoprrqqprooqrrpopprqpoprroqooooqqoqpopoooorrqpqprproroopppqqppqopporqqoopopqrrqopoqoprqqqqooqqqoprorppqopqopqqprrpoporppqpopoprqqroqoppqprqrqpooqrqoopppoppporqrpqorooq...

output:

YES

result:

ok answer is YES

Test #66:

score: 0
Accepted
time: 37ms
memory: 49524kb

input:

3000 3000
jjgfmkghlfpmmmkhgokkhlkimpfollinjmmmhofhjffjpggoijmfjlknoinilggnnjnfhhhlnhnkklplfmhkhoffnmlinkonkkngfjofjojopfpofnhmkokglkpoofnhhgkhhfokhmlimpojlipjgihpkpfloohnpllogimglffinghpgnoikhmmgnfllpkjifpigmgknnljgpjmfoijihmnpgofijlliikpimiophiipohomklkihkpklflnihkjmmgnmnjffkjhjjokfnkipgiigjoomppgo...

output:

YES

result:

ok answer is YES

Test #67:

score: 0
Accepted
time: 24ms
memory: 48856kb

input:

3000 3000
kghiifdchjifighdcchijgfggdfedijdjdbadgjdfdjekcfbdiiigcffibehdffjiekkkacggejiafijckkkaihhckkijcdfdkdcjagjfkjciccfiefccdhdkiikjcehieccbehbkakdjbikhkfkkiifikfkhefbaekbjccbaaefibacjfbijkgiefakgicjiiceafgcchgicicidbhhgicfbbcfajgiahghddekcdhccadjfgkkkdkcijfjjcijgdkgeijjdegacaacifjcaaffgecdgekakk...

output:

YES

result:

ok answer is YES

Test #68:

score: 0
Accepted
time: 42ms
memory: 48904kb

input:

3000 3000
iiljijlijllliliilljlliijjljliiiiijiiilliijliliijiijllijjiiiliilijiiilliijllililijiijljilililjiillijliljjjjjjiljljlljilliiiljljillljlllliiilijjillllilijiiilliiijjliljiliiillllijjljlijljjjiillljiiiiiljjiljjjillljjljljjljjljliiliijijliilllijliiljillllliiljiilililiilljlljijlljlijijllljiiiiijij...

output:

YES

result:

ok answer is YES

Test #69:

score: 0
Accepted
time: 37ms
memory: 48732kb

input:

3000 3000
rswdzgunjlzoeuyovgiuqkzztvxdrvpnkipfsgsomxrmjdmkivbldduttcqxfwtcatxaacaoyxknlxlxwjzzdeszelabhsfcwscffjlvmqyhwudmapaimfzdpsgdelceozpcbqjydukzltgkdxlsrxfzdardxqqywttybyaoteodljlbaqsfhueayxqjyzgupbmzwqnlkzclprsxnvuncviimcuksjvidzeqpdorkdbhhkrviscyrgtipfjpwghbixkmzispbxctzogjzzbhluaawnksshwifx...

output:

YES

result:

ok answer is YES

Test #70:

score: 0
Accepted
time: 34ms
memory: 48784kb

input:

3000 3000
foixjfpihrnomjkkfftkozxaidcrttnmebdbustiensoydoszkwwtmlgigyemqewkgxsjkpnblmiencyepnkbzgpuacjvyoxdexwbupgibwuxvqmeriauibanaapyfqurbzltpqxlpeweouzjirardupxgzdgxvueqjhzxrqxqebmdmkvtlibzurhsjpmifqefqfpqmaazwxiomqjbgmzbughqgwbqubymqmoiywuokzaritzsobupudjxxowupgwktaoskdxdpblnyttabvafblpeymlzxbii...

output:

YES

result:

ok answer is YES

Test #71:

score: 0
Accepted
time: 32ms
memory: 49056kb

input:

3000 3000
arjyzzqwzwulwtjmijrkxhclxaafussqqlyhjfhlwknfhjxfnlngmkiukcjmrdoogdctitzkprbahptsxqzxkxbdmkubsmoqbzloyzzvzlfphyudqsbpmxnizfjxzoirwvzzsbzslcslymnarfgckdypkikdcuttkbldwwyvhgeneaekzmlpddxqlxlqggfiehqdawegmptxyytvnoysrzadkmznxysmqybqwtflyogakemmuftvymhnqggxzxpfrzinwcuejvhjnfkrlgvgfbvrpqsnklmxik...

output:

YES

result:

ok answer is YES

Test #72:

score: 0
Accepted
time: 20ms
memory: 48892kb

input:

3000 3000
gykhhdnxbtecqkprmehyjvnmarsqdecvmtshzzfuxjbjcwzzkdvabmycdcupbnfjhxtauyqwyboomvofkdbfhnxkhdtpjoawccgsrgtgmrqzrcraoxycstipubhzvltiyrsmexzetuhjgqgcvxejbauyfaaosnlvvtpwwnqphmdcuxjuzlvrghiuiwqugaabozcowkzjtyyxjrxmsepzszsoywbspdkjvvkmktllpenjedcnwpstzahdqtqowrvdechrvuannqwoyogbvsrnjbqntrfgjycnaf...

output:

YES

result:

ok answer is YES

Test #73:

score: 0
Accepted
time: 29ms
memory: 48976kb

input:

3000 3000
ysxfvsdguztvfvbuxyepxfnirukybruffexshbbmtvixlxwcmtjslsexmibjrqaxuzcggdlitkgerxgrhwdcrlahyyexzngqeussxsvngdmbufpwuibiqndlppnpaeanfyiwnpttkikbaiehauviemcxlfrmnosjyecljbacmmyawoasdyzsktbnihnchjtgmbacwqgegmgsejtwkvglnjesurpgrdigtkwnegjjngtanborzkncqqkujnzruqkjmgmddqdrlzsycutxwyvhpxfjvhonlwoxqf...

output:

YES

result:

ok answer is YES

Test #74:

score: 0
Accepted
time: 37ms
memory: 48816kb

input:

3000 3000
snxwvzksmwkyuozmmxngiitqhtauvuklqjyqbtlmnrqhmmimuwlcukwouydrvtuxgjaoekaqzjkuodpkxdjwtlzqxnzjwgedaoijivmwygcvamriyosqclbzapmxrdmpmfwlcqfscbhtfwrbsvseialnegtsmdlujjjhfpiogmvqqrkbfdsonlbspoulstvmrgtadnzgxsedpybsledotzzltcsxukkrqitrxjwszxqswenqxkzjdqcxkcpjqkvpfftdphgcyvrtmffdvbzfapdkicrvcxuujw...

output:

NO

result:

ok answer is NO

Test #75:

score: 0
Accepted
time: 31ms
memory: 48740kb

input:

3000 3000
aeiqnbjvpmjhuxusvyirhgzqtbzewrqidosfygtmwuuzgojsakvmvwilltfhjdbkmlkbmhoqkeyjdeqcyffbyvslhinwqetdjyzpomudfesjrlrgvzahbsvyyqyqmrgjxnozudqtowagnmyjmfvpnmfijpzxmxutefusnfsnkvyyabrdpjyjbpwipgiiahucsgsvkgqietfqiloscuggglmlwchnssfmmtuspyskutmteyfiazszwglxkzwupdtbmqtcmsntavdnrbtvpuyotohavounwpxikn...

output:

YES

result:

ok answer is YES

Test #76:

score: 0
Accepted
time: 38ms
memory: 49584kb

input:

3000 3000
nwiaipghswlbivvzdgwxfpjvzzwguliythquuefhlqsoqfodjwinjhjqzfjrqvzwvgtrungwhorlcsgpardxqquiqigvgecbjkthvyhqhdblhzhievdthhllognedxpvlmpawsofrvbirkvtkssobwevdjxakeedhquzfxmyprhpozkanshssvmwpyjvxdrvklvsmbghfgtizjqhndegmigfuzkierjxriotvrwwoxqwxqndldhhkausauatkiclkdvudzxezzquegusaetiyrdghjvchefrnr...

output:

NO

result:

ok answer is NO

Test #77:

score: 0
Accepted
time: 42ms
memory: 50116kb

input:

3000 3000
kccaebaccggigihgfigfkjgeeefdcjibdidfcihkccgkkjijiagghfgjkdebadbdibjikjebdjgbecekcibehgdjgjchjbbjdbbjecbcbhiabdhccihhafhgcegbgedcdhihieidhkkfkdefgadbgkdebjgcgdcdiejeackhihecakkchagjdkfiiakhkahgkdchdhegkhfhjjjjbfbghceiiedefbehgichdcbdfacjafadfjggffgeiehhhacdbkabeigchajaibgdhfghdiickfdihidhfk...

output:

YES

result:

ok answer is YES

Test #78:

score: 0
Accepted
time: 35ms
memory: 48900kb

input:

3000 3000
ahgdffbikcddgihhckkajbacchckedieajjbhahdbdibibccdccehickahakcejhddffkefgejbaidjkddjcgafbbdbfgdjbkhccjahgfjekgkgkdgabedfhfcbggkcheediacbdgfaikhakhakfgkchdbfhbcffhhkhkffjdaidadjibhagedigdggfkcjcickeicfehchjgbfbghfjhkfkejihkfajddgceejicjhcafcjjcffkdeceabdhabgigfbfjbgjdhifadiahaccbfbhagkbfkhfc...

output:

NO

result:

ok answer is NO

Test #79:

score: 0
Accepted
time: 38ms
memory: 48816kb

input:

3000 3000
gcahebhfhbceeejefgkjcckcdkacekhffehhaahfdgkhjhjjdbfjiddaddkejcjhhbfeejahgciiigckighkgkdjcegifcdkhkgehjgcigjdhicbkfiffejhajccfeeikgkjddkchacccfeiigigfbfdfgacijkjjgcceiejakgjfjcbhfjkhbakkhcdhjfjbdjddibacdijcahaackeiiieikjdfgkghfdkbkaddbaedcbahkhfkbgckkbdibjdgdajfkhfddcgahfgbdjabggecchcijehah...

output:

YES

result:

ok answer is YES